start 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/env bash
  2. clear
  3. if ! timeout 1s xset 1 &>/dev/null;
  4. then
  5. echo -e "\e[92mWelcome Shirin!"
  6. echo -e "What session do you want to start?"
  7. echo
  8. echo -e "\e[95m1. Openbox"
  9. echo -e "2. pekwm"
  10. echo -e "3. Awesome"
  11. echo -e "4. i3wm"
  12. echo
  13. echo -e "\e[31mQ. Quit"
  14. echo
  15. echo -e "\e[93mInput number: "
  16. while true; do
  17. read opt
  18. if [[ "$opt" == 1 ]];
  19. then
  20. echo -e "launching Openbox"
  21. startx ~/.xinitrc openbox
  22. clear
  23. exit
  24. elif [[ "$opt" == 2 ]];
  25. then
  26. echo -e "Launching pekwm"
  27. startx ~/.xinitrc pekwm
  28. clear
  29. exit
  30. elif [[ "$opt" == 3 ]];
  31. then
  32. echo -e "Launching Awesome"
  33. startx ~/.xinitrc awesome
  34. clear
  35. exit
  36. elif [[ "$opt" == 4 ]];
  37. then
  38. echo -e "Launching i3WM"
  39. startx ~/.xinitrc i3wm
  40. clear
  41. exit
  42. elif [[ "$opt" == "q" || "$opt" == "Q" ]];
  43. then
  44. clear
  45. echo -e "Have a good day!"
  46. exit
  47. else
  48. echo -e "option invalid"
  49. fi
  50. done
  51. else
  52. echo -e "\e[31mXserver is running at $DISPLAY"
  53. echo -e "Exiting"
  54. exit
  55. fi