td-toggle (521B)
1 #!/usr/bin/env sh 2 # If transmission-daemon is running, will ask to kill, else will ask to start. 3 if pgrep -x transmission-da >/dev/null ; 4 then 5 [ "$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")" = "Yes" ] && killall transmission-da && notify-send "transmission-daemon killed." 6 else 7 ifinstalled transmission-cli || exit 8 [ "$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")" = "Yes" ] && transmission-daemon && notify-send "tranmission-daemon started." 9 fi 10 sleep 3 && pkill -RTMIN+7 i3blocks