scripts/lowbat.sh

13 lines
411 B
Bash
Raw Normal View History

2024-11-20 16:35:57 +01:00
#!/usr/bin/env bash
2024-11-20 16:38:00 +01:00
## This script assumes you are running KDE
2024-11-20 16:35:57 +01:00
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