summaryrefslogtreecommitdiff
path: root/.local/bin/sshchoose
blob: 84c2b742ddd38b44c0da11b5941d2057dc9b4b51 (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"