scripts/lowbat.sh

11 lines
367 B
Bash
Raw Normal View History

2024-11-20 16:35:57 +01:00
#!/usr/bin/env bash
SERVICE="syncthing"
if pgrep -x "$SERVICE" >/dev/null
then
## notify user that syncthing is stopping
notify-send -a $SERVICE -h "string:desktop-entry:org.kde.konsole" "Lowbatts, terminating $SERVICE to save power." "Recharge before using $SERVICE." --icon=dialog-information
## kill syncthing
syncthing cli operations shutdown
fi