I prepared a tiny application for Ubuntu based on the Golang. This application checks memory usage every N seconds, and if memory usage highest of M%, try to send a notification every K seconds.
This is a pretty straightforward implementation, but when I install that snap - notifications do not appear. When I run that command manually - it’s works awesome.
That application uses the notify-send
CLI tool to send the notification.
That my snapcraft.yaml:
name: low-ram-detector
base: core18
version: '0.1'
summary: Monitoring of RAM and swap
description: |
That app monitor RAW and swap, and send notifications if RAM or swap too low.
grade: stable
confinement: strict
parts:
low-ram-detector:
plugin: go
go-importpath: bitbucket.org/espinpro/go-engine
source: .
build-packages:
- build-essential
stage-packages:
- gcc
- clang
- libnotify-bin
build-environment:
- CGO_ENABLED: "1"
apps:
low-ram-detector:
environment:
LOW_RAM_DETECTOR_VERBOSE: "true"
LOW_RAM_DETECTOR_SWAPPERCENT: "80"
LOW_RAM_DETECTOR_PERCENT: "90"
command: bin/low_ram_detector
daemon: simple
plugs:
- desktop
Does anyone know how to fix it?