2018-09-15 13:11:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# If transmission-daemon is running, will ask to kill, else will ask to start.
|
|
|
|
|
2018-11-05 22:51:24 +00:00
|
|
|
[ ! -f /usr/bin/transmission-daemon ] && echo "Transmission not installed." && exit
|
|
|
|
|
|
|
|
if pgrep -x transmission-da >/dev/null ;
|
2018-09-15 13:11:24 +00:00
|
|
|
then
|
|
|
|
yn=$(printf "No\\nYes" | dmenu -i -p "Kill transmission-daemon?")
|
2018-11-05 22:51:24 +00:00
|
|
|
[ "$yn" = "Yes" ] && killall transmission-da
|
2018-09-15 13:11:24 +00:00
|
|
|
else
|
|
|
|
yn=$(printf "No\\nYes" | dmenu -i -p "Start transmission daemon?")
|
|
|
|
[ "$yn" = "Yes" ] && transmission-daemon
|
|
|
|
fi
|
|
|
|
sleep 3 && pkill -RTMIN+7 i3blocks
|