executable_rofi-mycli 2.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. if [ -z $@ ]
  3. then
  4. awk '/mysql:/{ print $1 }' "$HOME/.myclirc"
  5. else
  6. if [ "$(echo '(current-frame-smallp)' | stumpish -e eval )" == "0" ]; then
  7. size=10
  8. else
  9. size=8
  10. fi
  11. case "$@" in
  12. web*)
  13. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli --password "$(pass show majordomo/public/web/mysql/root)" -d $@ &>/dev/null &)
  14. ;;
  15. maxscale*)
  16. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli --password "$(pass show majordomo/public/majordomo/maxscale.intr/root)" -d $@ &>/dev/null &)
  17. ;;
  18. galera*)
  19. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli --password "$(pass show majordomo/public/majordomo/mysql.intr/galera1.intr/root)" -d $@ &>/dev/null &)
  20. ;;
  21. billing-dev*)
  22. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli --ssh-host workstation.intr --password "$(pass show majordomo/public/majordomo/dev.majordomo.ru/billing/xmlrpc)" -d $@ &>/dev/null &)
  23. ;;
  24. localhost*)
  25. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli -h localhost -u root -p $@ &>/dev/null; read &)
  26. ;;
  27. malscan*)
  28. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli --password "$(pass show malscan.intr/mysql/malscan)" -d $@ &>/dev/null &)
  29. ;;
  30. *)
  31. coproc (xterm -title "mycli@$@" -bg '#fff0f5' -fg '#000000' -fa Monospace -fs "$size" -e env PAGER='pspg -s 14 -X --force-uniborder --quit-if-one-screen -s 16' mycli -d $@ &>/dev/null &)
  32. ;;
  33. esac
  34. fi