summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/scripts/transadd25
-rwxr-xr-x.local/bin/scripts/transopen20
2 files changed, 35 insertions, 10 deletions
diff --git a/.local/bin/scripts/transadd b/.local/bin/scripts/transadd
index 9ec01a9..5ab3f24 100755
--- a/.local/bin/scripts/transadd
+++ b/.local/bin/scripts/transadd
@@ -1,17 +1,22 @@
#!/bin/sh
-# Local paths
-# directories="/home/andrew/Downloads
-# /home/andrew/Videos/Movies
-# /home/andrew/Videos/Series"
+hosts="raspberry
+localhost"
-# Paths on remote server
-directories="/var/lib/transmission-daemon/downloads/Movies
-/var/lib/transmission-daemon/downloads/Series
-/var/lib/transmission-daemon/downloads"
+host=$(printf "$hosts" | dmenu -p "Choose host" -i -l 5)
-host=$(pass Services/transmission/rpi-host)
-creds=$(pass Services/transmission/rpi-creds)
+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"
diff --git a/.local/bin/scripts/transopen b/.local/bin/scripts/transopen
new file mode 100755
index 0000000..3897ef0
--- /dev/null
+++ b/.local/bin/scripts/transopen
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Possible servers
+hosts="raspberry
+localhost"
+
+if [ -z "$1" ]; then
+ host=$(printf "$hosts" | fzf +m --reverse)
+else
+ host="$1"
+fi
+
+case $host in
+ localhost) tremc -c localhost ;;
+ raspberry)
+ host=$(pass Services/transmission/rpi-host)
+ creds=$(pass Services/transmission/rpi-creds)
+ tremc -c "$creds@$host" ;;
+esac
+