dotfiles/config/i3/sshmenu
2017-01-14 18:42:55 +01:00

10 lines
284 B
Bash
Executable file

#!/bin/bash
if [ "$1" == 'root' ]; then
a=" (root)"
b="sudo -E "
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
xterm -e "ssh $machine -t '${b}bash --login'"
fi