voidrice/.local/bin/td-toggle

13 lines
546 B
Text
Raw Permalink Normal View History

#!/bin/sh
2018-09-15 13:11:24 +00:00
# If transmission-daemon is running, will ask to kill, else will ask to start.
2020-04-13 15:49:40 +00:00
if pidof transmission-daemon >/dev/null ;
2018-09-15 13:11:24 +00:00
then
[ "$(printf "No\\nYes" | dmenu -i -p "Turn off transmission-daemon?")" = "Yes" ] && killall transmission-daemon && notify-send "transmission-daemon disabled."
2018-09-15 13:11:24 +00:00
else
2019-01-26 23:13:36 +00:00
ifinstalled transmission-cli || exit
[ "$(printf "No\\nYes" | dmenu -i -p "Turn on transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "transmission-daemon enabled."
2018-09-15 13:11:24 +00:00
fi
sleep 3 && pkill -RTMIN+7 "${STATUSBAR:-dwmblocks}"