summaryrefslogtreecommitdiff
path: root/.local/bin/scripts/transadd
blob: 5ab3f24b369f40c71c563d45e60ba93798968fea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

hosts="raspberry
localhost"

host=$(printf "$hosts" | dmenu -p "Choose host" -i -l 5)

case $host in 
    localhost) 
        host="localhost"
        creds=""
        directories="$HOME/downloads" ;;
    raspberry)
        host=$(pass Services/transmission/rpi-host)
        creds=$(pass Services/transmission/rpi-creds)
        directories="/var/lib/transmission-daemon/downloads/Movies
/var/lib/transmission-daemon/downloads/Series
/var/lib/transmission-daemon/downloads" ;;
esac

dest=$(printf "$directories" | dmenu -p "Choose destination" -i -l 5)
transmission-remote $host -n $creds -a "$@" -w "$dest" && notify-send "Torrent added"