scripts/rofi/rofi-ssh-menu.sh

37 lines
1.7 KiB
Bash
Raw Normal View History

2020-09-11 15:00:39 +00:00
#!/bin/bash
2020-11-23 09:35:26 +00:00
res=$(echo "john.me.tz|root@john.me.tz|t470s.lan.john.me.tz|shb.ng|\
kipary.fastnet.ch|media.lan.john.me.tz|pipcam0.lan.john.me.tz|\
therm.lan.john.me.tz|hud.lan.john.me.tz|vm.lan.john.me.tz|mac.lan.john.me.tz" | \
2020-11-23 09:35:26 +00:00
rofi -sep "|" -dmenu -i -p 'P ' "" -columns 1 -rows 1 -width 45 -l 1 -config \
/home/jpm/.config/rofi/config -hide-scrollbar -eh 1 -location 0 -yoffset 0 \
-padding 12 -opacity 100 -auto-select -no-fullscreen)
2020-09-11 15:00:39 +00:00
echo $res > /home/jpm/.last_ssh_shortcut
2020-09-11 15:00:39 +00:00
if [ $res = "john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs w'
2020-09-11 15:00:39 +00:00
elif [ $res = "root@john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs r'
2020-09-11 15:00:39 +00:00
elif [ $res = "shb.ng" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs s'
elif [ $res = "kipary.fastnet.ch" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs d'
2020-09-11 15:00:39 +00:00
elif [ $res = "camera.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs c'
2020-09-11 15:00:39 +00:00
elif [ $res = "hud.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs h'
2020-09-11 15:00:39 +00:00
elif [ $res = "media.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs m'
2020-09-11 15:00:39 +00:00
elif [ $res = "programmer.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs p'
2020-09-11 15:00:39 +00:00
elif [ $res = "t470s.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs l'
2020-09-11 15:00:39 +00:00
elif [ $res = "therm.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs t'
2020-09-11 15:00:39 +00:00
elif [ $res = "vm.lan.john.me.tz" ]; then
2020-11-23 09:35:26 +00:00
/usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs v'
elif [ $res = "mac.lan.john.me.tz" ]; then
/usr/bin/gvncviewer 192.168.2.10 >> /home/jpm/macos
2020-09-11 15:00:39 +00:00
fi
exit 0