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

hosts="raspberry
desktop
localhost"

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

case $host in 
    localhost) 
        host="localhost"
        creds=""
        directories="$HOME/Downloads" ;;
    desktop)
        host=$(pass Services/transmission/desktop-host)
        creds=$(pass Services/transmission/desktop-creds)
        directories="/home/andrew/Downloads" ;;
    raspberry)
        host=$(pass Services/transmission/rpi-host)
        creds=$(pass Services/transmission/rpi-creds)
        directories="/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"