diff --git a/scripts/cmenu.sh b/scripts/cmenu.sh index 89d2a2f..97938a4 100755 --- a/scripts/cmenu.sh +++ b/scripts/cmenu.sh @@ -1,6 +1,8 @@ #!/bin/bash -DMENU="$(dirname $0)/dmenu.sh" +cd $(dirname $0) + +DMENU="./dmenu.sh" menu() { echo $@ | tr ' ' '\n' | $DMENU } @@ -21,7 +23,7 @@ require-service() { systemctl is-active --quiet $service || sysctl start $service } -case "$(menu timer screenshot wallpaper wicd ncmpcpp zomnet power)" in +case "$(menu timer screenshot wallpaper wicd ncmpcpp ssh zomnet power)" in timer) exec urxvt -geometry 50x3 -e ~/.config/scripts/teatimer.sh ;; @@ -44,6 +46,12 @@ case "$(menu timer screenshot wallpaper wicd ncmpcpp zomnet power)" in ncmpcpp) exec urxvt -e ncmpcpp ;; + ssh) + host=$(menu `./ssh_hosts.sh`) + if [ -n "$host" ]; then + exec urxvt -e ssh $host + fi + ;; zomnet) case "$(menu start-stop uservm ncmpcpp deluge)" in start-stop) diff --git a/scripts/ssh_hosts.sh b/scripts/ssh_hosts.sh new file mode 100755 index 0000000..e95e219 --- /dev/null +++ b/scripts/ssh_hosts.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +CONFIG="$HOME/.ssh/config" + +if [ -f "$CONFIG" ]; then + cat "$CONFIG" | awk '{if($1=="Host"){print $2}}' +fi