splash.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. if [ $(dpkg-query -W -f='${Status}' dialog 2>/dev/null | grep -c "ok installed") -eq 0 ];
  3. then
  4. sudo apt-get install dialog -y;
  5. fi
  6. SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
  7. #echo $SCRIPTPATH
  8. HEIGHT=15
  9. WIDTH=40
  10. CHOICE_HEIGHT=8
  11. BACKTITLE="CHIU!"
  12. TITLE="Chiu Launcher"
  13. MENU="Choose:"
  14. OPTIONS=(1 "htop"
  15. 2 "alpine"
  16. 3 "newsbeuter"
  17. 4 "profanity (xmpp+irc_gw)"
  18. 5 "stats"
  19. 6 "Shutdown!"
  20. 7 "LOCK")
  21. CHOICE=$(dialog --clear \
  22. --backtitle "$BACKTITLE" \
  23. --title "$TITLE" \
  24. --menu "$MENU" \
  25. $HEIGHT $WIDTH $CHOICE_HEIGHT \
  26. "${OPTIONS[@]}" \
  27. 2>&1 >/dev/tty)
  28. clear
  29. case $CHOICE in
  30. 1)
  31. htop && $SCRIPTPATH/./splash.sh
  32. ;;
  33. 2)
  34. alpine && $SCRIPTPATH/./splash.sh
  35. ;;
  36. 3)
  37. newsbeuter && $SCRIPTPATH/./splash.sh
  38. ;;
  39. 4)
  40. profanity && $SCRIPTPATH/./splash.sh
  41. ;;
  42. 5)
  43. $SCRIPTPATH/./stats.sh && $SCRIPTPATH/./splash.sh
  44. ;;
  45. 6)
  46. sudo shutdown -h now
  47. ;;
  48. 7)
  49. vlock && $SCRIPTPATH/./splash.sh
  50. ;;
  51. esac
  52. ##source: https://stackoverflow.com/questions/40193222/dialog-show-menu-after-option-has-been-executed