Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. #!/bin/bash
  2. # change_es_systems.sh
  3. #############
  4. # This script lets you change the es_systems.cfg file used to display systems using your controllers.
  5. #
  6. # v4
  7. # TMNTturtlguy - July 9 2017
  8. #
  9. # place script in /home/pi/RetroPie/retropiemenu/
  10. # In order to run the script you must create the following folders:
  11. # /opt/retropie/configs/all/emulationstation/es_systems
  12. # Then within that folder create these 6 folders:
  13. # All
  14. # Consoles
  15. # Customs
  16. # Favorites
  17. # Hacks
  18. # Neocapcom
  19. # Example of the full path: /opt/retropie/configs/all/emulationstation/es_systems/Favorites
  20. # Within each folder you have created place a es_systems.cfg file. The file needs to be named the same in each folder, but the systems can be different.
  21. # Restart EmulationStation and the script is located in the retropie menu
  22. # Special Thanks to @meleu and @cyperghost for their hard work helping trouble shoot this script and comming up with a way to restart ES.
  23. #
  24. #
  25.  
  26. #scirpt welcome screen
  27. dialog --backtitle "W A R N I N G !" --title " WARNING! " \
  28. --yesno "\nThis script lets you change your es_systems.cfg file used to display systems. This will not change or remove any systems or content, it will change which systems are displayed based on user created es_systems.cfg files. ES will automatically restart.\n\n\nDo you want to proceed?" \
  29. 15 75 2>&1 > /dev/tty \
  30. || exit
  31.  
  32. function restart_es() {
  33. touch /tmp/es-restart && pkill -f "/opt/retropie/supplementary/.*/emulationstation([^.]|$)"
  34. exit
  35. }
  36.  
  37. function main_menu() {
  38. local choice
  39.  
  40. while true; do
  41. choice=$(dialog --backtitle "$BACKTITLE" --title " MAIN MENU " \
  42. --ok-label OK --cancel-label Exit \
  43. --menu "What do you want to do?" 17 75 10 \
  44. B "Run roms from NAS" \
  45. E "Run roms from SD/USB" \
  46. 2>&1 > /dev/tty)
  47.  
  48. case "$choice" in
  49. B) change_to_nas ;;
  50. E) change_to_sd ;;
  51. *) break ;;
  52. esac
  53. done
  54. }
  55.  
  56.  
  57. function change_to_nas() {
  58. rm /opt/retropie/configs/all/emulationstation/es_systems.cfg
  59. cp /opt/retropie/configs/all/emulationstation/es_systems/NAS/es_systems.cfg /opt/retropie/configs/all/emulationstation/
  60. restart_es
  61. }
  62.  
  63. function change_to_sd() {
  64. rm /opt/retropie/configs/all/emulationstation/es_systems.cfg
  65. cp /opt/retropie/configs/all/emulationstation/es_systems/SD/es_systems.cfg /opt/retropie/configs/all/emulationstation/
  66. restart_es
  67. }
  68.  
  69. # START HERE #################################################################
  70.  
  71. main_menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement