21 lines
693 B
Bash
Executable file
21 lines
693 B
Bash
Executable file
#!/bin/sh
|
|
|
|
check () { \
|
|
! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "transmission daemon enabled."
|
|
}
|
|
|
|
case "$1" in
|
|
toggle)
|
|
if pidof transmission-daemon >/dev/null ;
|
|
then
|
|
prompt "Turn off transmission-daemon?" "transmission-remote --exit" && notify-send "transmission-daemon disabled."
|
|
else
|
|
prompt "Turn on transmission-daemon?" "transmission-daemon" && notify-send "transmission-daemon enabled."
|
|
fi ;;
|
|
open)
|
|
check ; $TERMINAL tremc -X ;;
|
|
add)
|
|
check ; sleep 1 && transmission-remote -a "$2" && notify-send "Torrent added." ;;
|
|
*)
|
|
notify-send "$TR_TORRENT_NAME downloaded." ; sleep 60 && transmission-remote -t ${TR_TORRENT_ID} -r
|
|
esac
|