From 3fe571af76bef57861103e3da5df8c913ad13c33 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 22 May 2021 10:59:18 +0400 Subject: Added more flexible config for opening transmission client for different servers --- .local/bin/scripts/transopen | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .local/bin/scripts/transopen (limited to '.local/bin/scripts/transopen') 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 + -- cgit v1.2.3