summaryrefslogtreecommitdiff
path: root/.local/bin/sshchoose
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-13 19:04:22 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-13 19:04:22 -0500
commit719c3734ff2d247b386e398b4cf98aa62c6f6cc0 (patch)
tree324522598ff677ee092e4e1047304dcc7d5f7567 /.local/bin/sshchoose
parentbf434758d9c60c323d571bc1e2e329edaad06fa3 (diff)
Cool new sshchoose prompt
Diffstat (limited to '.local/bin/sshchoose')
-rwxr-xr-x.local/bin/sshchoose8
1 files changed, 6 insertions, 2 deletions
diff --git a/.local/bin/sshchoose b/.local/bin/sshchoose
index 6b884c6..378ab73 100755
--- a/.local/bin/sshchoose
+++ b/.local/bin/sshchoose
@@ -1,6 +1,10 @@
#!/bin/sh
-choice="$(pass ls ssh/ | sed '1d;s/^.*\s//g' | fzf)"
+# user@host are stored in pass under the ssh/ directory
+available="$(pass ls ssh/ | sed '/^ssh$/d;s/.*─\s//' | sed 's/\x1b\[[0-9;]*m//g')"
-ssh "$(pass ssh/$choice)"
+choice="$(echo "$available" | dmenu -p " Choose session")"
+addr="$(pass "ssh/$choice")"
+
+dropdowntoggle "ssh-$choice" "tmux-ssh" "choice" "$addr"