Skip to content

Instantly share code, notes, and snippets.

@dcasati
Created October 26, 2013 21:01
Show Gist options
  • Save dcasati/7174478 to your computer and use it in GitHub Desktop.
Save dcasati/7174478 to your computer and use it in GitHub Desktop.
ssh keybind via dmenu
#!/bin/sh
# a simplified version based on ideas from
# https://opensource.conformal.com/fluxbb/viewtopic.php?id=473
# you need to bind this program to a proper shortcut on your wm
# for instance on i3 I use the following:
# bindsym $mod+k exec /usr/local/bin/dmenu_ssh
SSH_TO=`awk '/^Host/{print $2}' $HOME/.ssh/config | dmenu`
XTERM_OPTS="-bg black -fg grey +sb"
if [ $SSH_TO ]; then
xterm $XTERM_OPTS -e ssh $SSH_TO;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment