A variety of simple automation scripts and enhancements to Sway and i3.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.8KB

  1. #!/bin/bash
  2. res=$(echo "john.me.tz|root@john.me.tz|t470s.lan.john.me.tz|shb.ng|\
  3. kipary.fastnet.ch|media.lan.john.me.tz|pipcam0.lan.john.me.tz|\
  4. therm.lan.john.me.tz|hud.lan.john.me.tz|vm.lan.john.me.tz|mac.lan.john.me.tz|AndroidUSB" | \
  5. rofi -sep "|" -dmenu -i -p 'P ' "" -columns 1 -rows 1 -width 45 -l 1 -config \
  6. /home/jpm/.config/rofi/config.rasi -hide-scrollbar -eh 1 -location 0 -yoffset 0 \
  7. -padding 12 -opacity 100 -auto-select -no-fullscreen)
  8. echo $res > /home/jpm/.last_ssh_shortcut
  9. if [ $res = "john.me.tz" ]; then
  10. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs w'
  11. elif [ $res = "root@john.me.tz" ]; then
  12. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs r'
  13. elif [ $res = "shb.ng" ]; then
  14. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs s'
  15. elif [ $res = "kipary.fastnet.ch" ]; then
  16. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs d'
  17. elif [ $res = "camera.lan.john.me.tz" ]; then
  18. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs c'
  19. elif [ $res = "hud.lan.john.me.tz" ]; then
  20. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs h'
  21. elif [ $res = "media.lan.john.me.tz" ]; then
  22. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs m'
  23. elif [ $res = "programmer.lan.john.me.tz" ]; then
  24. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs p'
  25. elif [ $res = "t470s.lan.john.me.tz" ]; then
  26. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs l'
  27. elif [ $res = "therm.lan.john.me.tz" ]; then
  28. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs t'
  29. elif [ $res = "vm.lan.john.me.tz" ]; then
  30. /usr/bin/urxvt -e /bin/bash -c '/home/jpm/scripts/sshs v'
  31. elif [ $res = "mac.lan.john.me.tz" ]; then
  32. /usr/bin/gvncviewer 192.168.2.10 >> /home/jpm/macos
  33. elif [ $res = "AndroidUSB" ]; then
  34. /usr/bin/scrcpy
  35. fi
  36. exit 0