#!/usr/bin/env bash
## This script assumes you are running KDE
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