scripts/onbat.sh
2024-11-20 16:35:57 +01:00

11 lines
355 B
Bash
Executable file

#!/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" "Terminating to save power." "Restart manually if you need $SERVICE." --icon=dialog-information
## kill syncthing
syncthing cli operations shutdown
fi