Advertisement
Push28

rom storage selector

Aug 28th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.48 KB | None | 0 0
  1. #!/bin/bash
  2. INPUT=/tmp/menu.sh.$$
  3. OUTPUT=/tmp/output.sh.$$
  4. trap "rm $INPUT; exit" SIGHUP SIGINT SIGTERM
  5. function display_output(){
  6.     local h=${1-82}
  7.     local w=${2-82}
  8.     local t=${3-Output}
  9.     dialog --backtitle "GameWizard Boot Selector" --title "${t}" --clear --msgbox "$(<$OUTPUT)" ${h} ${w}
  10. }
  11.  
  12. function esu(){
  13.     clear
  14.     sudo umount /dev/sda1
  15.     sudo mount /dev/sda1 /home/pi/RetroPie/roms
  16.     emulationstation
  17.     break
  18. }
  19. function ess(){
  20.     clear
  21.     emulationstation
  22. }
  23. function desktop(){
  24.     clear
  25.     sudo startx
  26.     clear
  27.     break
  28. }
  29. function rebt(){
  30.     clear
  31.     echo thanks for using Gamewizard Boot-Menu
  32.     sleep 5
  33.     sudo reboot now
  34.     break
  35. }
  36. function shut(){
  37.     clear
  38.     echo thanks for using Gamewizard Boot-Menu
  39.     sleep 5
  40.     sudo shutdown -h now
  41.     break
  42. }
  43. while true
  44. do
  45. dialog --clear --backtitle "GameWizard Boot Selector" \
  46. --title "[ G A M E W I Z A R D   B O O T - M E N U]" \
  47. --menu "You can use the UP/DOWN arrow keys, the first letter of the choice as a hot key, or the number keys 1-4 to choose an option.\n\
  48. Choose the TASK" 50 165 5 \
  49. 1-ES-USB "Boot EmulationStation using USB device as rom storage" \
  50. 2-ES-SD "Boot EmulationStation using SD-card as rom storage" \
  51. 3-Raspbian "Boot to Desktop" \
  52. 4-Reboot "Reboot cuz you forgot to plug your usb drive LOL" \
  53. 5-Shutdown "Do i really neet to put a description here ??" 2>"${INPUT}"
  54. menuitem=$(<"${INPUT}")
  55. case $menuitem in
  56.     1-ES-USB) esu;;
  57.     2-ES-SD) ess;;
  58.     3-Rasbian) desktop;;
  59.     4-Reboot) rebt;;
  60.     5-Shutdown) shut;;
  61. esac
  62. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement