summaryrefslogtreecommitdiff
path: root/.local/bin/sshchoose
blob: 397d9355012803c4f8964a687dabf0fd9dbda516 (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

# 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')"

choice="$(echo "$available" | dmenu -p " Choose session" | sed 's/\s//g')"

addr="$(pass "ssh/$choice")"

dropdowntoggle "ssh-$choice" "tmux-ssh" "$choice" "$addr"