Homepage Forums RetroPie Project Everything else related to the RetroPie Project Need Help creating shutdown shell script

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #107062
    majerle9
    Participant

    Total noob and don’t really know what I’m doing. I’d love it if someone could help me with this.

    I want to be able to create a Shutdown option inside of my system menu. It will be in my list of ROMs so it will shutdown the system without having to use the EmulationStation menu. That way I can disable the Select and Start buttons in EmulationStation to make it childproof and not let anyone accidentally change my settings.

    In es_systems.cfg I changed NES to allow .sh extensions.

    <system>
    <name>nes</name>
    <fullname>Nintendo Entertainment System</fullname>
    <path>~/RetroPie/roms/nes</path>
    <extension>.nes .zip .NES .ZIP .sh</extension>
    <command>/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ nes %ROM%</command>
    <platform>nes</platform>
    <theme>nes</theme>
    </system>

    Now I would like to create a shutdown.sh file to get it to turn the system off. I have no idea how to do that. I was hoping someone could help me out. I’m guessing it would look something like this only much better and actually functional:

    #!/bin/bash
    /sbin/shutdown -h -P now

    Can someone help me write this? Will it even work? Or am I way off track trying to set this up?

    #107108
    momaw27
    Participant

    Hmmm, this sounds like a good idea. If at all possible, I’d like to have the script shutdown in such a way that the ‘number of times played’ function in ES saves properly as well.

    Thanks!

    #107305
    majerle9
    Participant

    I would love that as well. I’m trying to figure out if there is a way to quit Emulationstation that doesn’t involve F4 or using the EmulationStation GUI menu.

    #107526
    smithers
    Participant

    Hi.
    This is entirely possible. It is something I am going to implement on my arcade cab when I get round to it, but I will be creating a ‘Power’ menu with its own theme etc. I will happily share when I have it up and running.

    The script I will use is:

    sudo poweroff

    It seems to shut the Pi down in the normal manner, however if anyone would care to correct me then go ahead – I could be wrong! I know there are shutdown commands to halt process etc. But the command above looks as though it halts the system the same as a normal shutdown via the emulation station ‘start menu’ would to me?

    #108226
    smithers
    Participant

    Hi.

    I finally got round to creating a ‘Power’ option in Emulation Station. It works great from what I have tested so far.

    I have an idea of how I would like it to look and feel but I am terrible with graphics design so it is very basic looking at the moment.

    I will upload a video tonight and show you my idea, but basically I intend for there to be no gamelist inside the theme and instead only pictures of power and reboot buttons. Hope that makes sense but you will see what I mean in the video!

    Cheers.
    Steve

    #108248
    smithers
    Participant

    OK as promised, here is a video of what I have set up:

    https://youtu.be/cbuucirv06A

    Need to sort out some decent looking power icons but otherwise it works great! It could also be used to create a custom script every time you shutdown, ie to switch a boot partition etc.

    If anyone artistic would care to create a set of good looking power buttons then that would be great!

    Let me know if you would like a copy of what I have so far.

    Cheers.
    Steve

    #109301
    nosedeath
    Participant

    I just watched the video…Very nice, I like that a lot. Ya I’d love to see what you did. Now I’m not very Linux savvy so go easy.

    #111735
    zigurana
    Participant
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Everything else related to the RetroPie Project’ is closed to new topics and replies.