dotfiles/config/i3/sshmenu
2018-07-10 14:50:07 +02:00

10 lines
268 B
Bash
Executable file

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