dots/.local/bin/torwrap

24 lines
733 B
Text
Raw Normal View History

2022-08-02 15:20:41 +02:00
#!/bin/sh
check () { \
! pidof transmission-daemon >/dev/null && transmission-daemon && notify-send "transmission daemon enabled."
}
2022-11-14 21:33:24 +01:00
while getopts 'toar' OPTION; do
case "$OPTION" in
t)
if pidof transmission-daemon >/dev/null ;
then
prompt "Turn off transmission-daemon?" "pkill transmission-da" && notify-send "transmission-daemon disabled."
else
prompt "Turn on transmission-daemon?" "transmission-daemon" && notify-send "transmission-daemon enabled."
fi ;;
o)
check ; $TERMINAL tremc ;;
a)
check ; sleep 1 && transmission-remote -a "$2" && notify-send "Torrent added." ;;
r)
notify-send "$TR_TORRENT_NAME downloaded." && sleep 60 && transmission-remote -t ${TR_TORRENT_ID} -r
esac
done