RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Emulationstation Shutdown Script Issue

    Scheduled Pinned Locked Moved Help and Support
    shutdownpoweremustation
    7 Posts 3 Posters 306 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TPRT
      TPR
      last edited by

      I added a very simple script to my front end on emulationstation to give myself a "shutdown" button next to all the consoles. Here's what I've done:

      In es_systems.cfg:
      <system>
      <name>power</name>
      <fullname>Power Menu</fullname>
      <path>~/RetroPie/roms/power</path>
      <extension>.sh .SH</extension>
      <command>sudo bash %ROM%</command>
      <platform>linux</platform>
      <theme>power</theme>
      </system>

      Shutdown.sh contains:
      sudo shutdown -h now

      The script actually works just fine and shuts down the system.

      Here's the issue...

      If I've added any games to my "favorites" folder in emulationstation, when I reboot the system, they are gone.

      If I use the original shutdown in the emulationstation menu, I can shutdown with the favorites still being there.

      Any idea what I'm doing wrong with that script that is causing the favorites not to get saved when the system shuts down?

      1 Reply Last reply Reply Quote 1
      • sugarfreeS
        sugarfree
        last edited by sugarfree

        t looks like your system is performing a hard/fast shutdown without saving metadata or favorites first, like RetroPie shutdown does.
        I believe this is related to EmulationStation. You need to find a way for EmulationStation to save the changes before the shutdown occurs.

        TPRT 1 Reply Last reply Reply Quote 0
        • TPRT
          TPR @sugarfree
          last edited by

          @sugarfree said in Emulationstation Shutdown Script Issue:

          t looks like your system is performing a hard/fast shutdown without saving metadata or favorites first, like RetroPie shutdown does.
          I believe this is related to EmulationStation. You need to find a way for EmulationStation to save the changes before the shutdown occurs.

          Hmm… that would make sense. Is there a command to kill a process properly that shuts it down with saving data? I tried adding “kill emulationstation” in the script, which did work for shutting down es but same results with data not being saved.

          sugarfreeS 1 Reply Last reply Reply Quote 0
          • sugarfreeS
            sugarfree @TPR
            last edited by

            @TPR You have to make ES to save the changes not to kill it .
            You can try emulationstation -h in the terminal to see all available options.

            TPRT 1 Reply Last reply Reply Quote 0
            • TPRT
              TPR @sugarfree
              last edited by

              @sugarfree said in Emulationstation Shutdown Script Issue:

              @TPR You have to make ES to save the changes not to kill it .
              You can try emulationstation -h in the terminal to see all available options.

              Doesn't seem to be much here for quitting the application:
              Screenshot 2025-03-23 10-08-42.png

              1 Reply Last reply Reply Quote 0
              • LolonoisL
                Lolonois
                last edited by

                In ES there is a menuitem Save Metadata, set it to Always. Then you should be able to hard kill ES via shutdown/reboot without losing changes to gamelists / favorites / collections.

                TPRT 1 Reply Last reply Reply Quote 2
                • TPRT
                  TPR @Lolonois
                  last edited by

                  @Lolonois said in Emulationstation Shutdown Script Issue:

                  In ES there is a menuitem Save Metadata, set it to Always. Then you should be able to hard kill ES via shutdown/reboot without losing changes to gamelists / favorites / collections.

                  BAM!!!

                  That worked!

                  Thank you! Not sure how I never noticed that option before! Almost seems like “always” should be the default.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.