dotfiles/config/i3/sshmenu

10 lines
268 B
Plaintext
Raw Normal View History

2017-01-14 17:42:55 +00:00
#!/bin/bash
2016-12-11 07:12:15 +00:00
if [ "$1" == 'root' ]; then
a=" (root)"
2017-02-12 14:31:40 +00:00
b="-t 'sudo -s'"
fi
machine=$(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p "SSH$a to ")
if [ ! -z $machine ]; then
2018-07-10 12:50:07 +00:00
urxvtc -e ssh $machine $b
2016-12-11 07:12:15 +00:00
fi