add a configurable daemon that warns on low battery

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Cette révision appartient à :
noneofyourbusiness 2021-06-16 17:52:24 +02:00 révisé par Maarten van Gompel
Parent 60dd08fa27
révision c7e0e3b656
7 fichiers modifiés avec 131 ajouts et 1 suppressions

Voir le fichier

@ -69,3 +69,22 @@ export SXMO_LOCK_SCREEN_OFF=1
# Or, enable vibration feedback on keypress
#export KEYBOARD_ARGS="-o | clickclack -V"
## Configuration parameters for sxmo_batterymonitor ##
# The following values are the defaults
# enable (1) or disable (0) the warning
#export BM_WARN=1
# enable (1) or disable (0) repeating warnings and hook executions
#export BM_LOOP=0
# set a threshold for the warning
#export BM_WARN_THRESHOLD=15
# set a threshold for the action (executes battery hook)
#export BM_WARN_CRIT_THRESHOLD=5
#let the daemon check every 5 minutes (300s)
sxmo_batterymonitor -i 300

Voir le fichier

@ -0,0 +1,6 @@
#!/usr/bin/env sh
# This script is executed when sxmo_batterymonitor detects a battery capacity below the set threshold
# You can use it to shutdown, play a notification sound, send a message, etc
mpv --no-video /usr/share/sxmo/notify.ogg >/dev/null && notify-send \"battery low\" && sxmo_vibratepine 1500 &

Voir le fichier

@ -0,0 +1,6 @@
#!/usr/bin/env sh
# This script is executed when sxmo_batterymonitor detects a battery capacity below the set threshold
# You can use it to shutdown, play a notification sound, send a message, etc
sudo busybox poweroff

1
configs/sudo/poweroff Fichier normal
Voir le fichier

@ -0,0 +1 @@
ALL ALL=NOPASSWD: /bin/busybox poweroff