Advertisement
Guest User

Untitled

a guest
Mar 16th, 2019
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. infobox= ""
  4. infobox="${infobox}_______________________________________________________\n\n"
  5. infobox="${infobox}\n"
  6. infobox="${infobox}Video Launching Utility\n\n"
  7. infobox="${infobox}\n"
  8. infobox="${infobox}This script will enable or disable the system launching videos.\n"
  9. infobox="${infobox}\n"
  10. infobox="${infobox}\n\n"
  11.  
  12. dialog --backtitle "RetroPie System Launching Videos" \
  13. --title "RetroPie System Launching Videos" \
  14. --msgbox "${infobox}" 20 70
  15.  
  16. function main_menu() {
  17. local choice
  18.  
  19. while true; do
  20. choice=$(dialog --backtitle "$BACKTITLE" --title " MAIN MENU " \
  21. --ok-label OK --cancel-label Exit \
  22. --menu "What action would you like to perform?" 25 75 20 \
  23. 1 "Disable system launching videos" \
  24. 2 "Enable system launching videos" \
  25. 2>&1 > /dev/tty)
  26.  
  27. case "$choice" in
  28. 1) disable_script ;;
  29. 2) enable_script ;;
  30. *) break ;;
  31. esac
  32. done
  33. }
  34.  
  35. function disable_script() {
  36. dialog --infobox "...processing..." 3 20 ; sleep 2
  37. perl -pi -w -e 's/enablevideolaunch=\"true\"/enablevideolaunch=\"false\"/g;' /opt/retropie/configs/all/runcommand-onstart.sh
  38. sleep 2
  39. }
  40.  
  41. function enable_script() {
  42. dialog --infobox "...processing..." 3 20 ; sleep 2
  43. perl -pi -w -e 's/enablevideolaunch=\"false\"/enablevideolaunch=\"true\"/g;' /opt/retropie/configs/all/runcommand-onstart.sh
  44. sleep 2
  45. }
  46.  
  47. main_menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement