Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- INPUT=/tmp/menu.sh.$$
- OUTPUT=/tmp/output.sh.$$
- trap "rm $INPUT; exit" SIGHUP SIGINT SIGTERM
- function display_output(){
- local h=${1-82}
- local w=${2-82}
- local t=${3-Output}
- dialog --backtitle "GameWizard Boot Selector" --title "${t}" --clear --msgbox "$(<$OUTPUT)" ${h} ${w}
- }
- function esu(){
- clear
- sudo umount /dev/sda1
- sudo mount /dev/sda1 /home/pi/RetroPie/roms
- emulationstation
- break
- }
- function ess(){
- clear
- emulationstation
- }
- function desktop(){
- clear
- sudo startx
- clear
- break
- }
- function rebt(){
- clear
- echo thanks for using Gamewizard Boot-Menu
- sleep 5
- sudo reboot now
- break
- }
- function shut(){
- clear
- echo thanks for using Gamewizard Boot-Menu
- sleep 5
- sudo shutdown -h now
- break
- }
- while true
- do
- dialog --clear --backtitle "GameWizard Boot Selector" \
- --title "[ G A M E W I Z A R D B O O T - M E N U]" \
- --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\
- Choose the TASK" 50 165 5 \
- 1-ES-USB "Boot EmulationStation using USB device as rom storage" \
- 2-ES-SD "Boot EmulationStation using SD-card as rom storage" \
- 3-Raspbian "Boot to Desktop" \
- 4-Reboot "Reboot cuz you forgot to plug your usb drive LOL" \
- 5-Shutdown "Do i really neet to put a description here ??" 2>"${INPUT}"
- menuitem=$(<"${INPUT}")
- case $menuitem in
- 1-ES-USB) esu;;
- 2-ES-SD) ess;;
- 3-Rasbian) desktop;;
- 4-Reboot) rebt;;
- 5-Shutdown) shut;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement