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

    Script in autostart

    Scheduled Pinned Locked Moved Help and Support
    retropie4.6scriptautostart.sh
    3 Posts 2 Posters 751 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.
    • C
      Codafire
      last edited by

      Hi again friends.

      Im trying to run an script when my retropie starts, my autostart.sh its like that:

      while pgrep omxplayer >/dev/null; do sleep 1; done
      (sleep 10; mpg123 -Z /home/pi/bgm/*.mp3 >/dev/null 2>&1) &
      emulationstation #auto
      myscript.sh

      If i run the script it works perfect in the command line but not doing nothing at start. Its something wrong? Its a script that erase a file, inside the script i have

      rm -f (and the folder and file)
      Im not at home so i cant remember full folder

      Any ideas? Thanks

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @Codafire
        last edited by

        @codafire Your script seems to be running after EmulationStation, so it won't run until EmulationStation is stopped/restarted.

        C 1 Reply Last reply Reply Quote 0
        • C
          Codafire @mitu
          last edited by Codafire

          @mitu ok i try to put it before emulationstation runs, basically the script erase an empty file that i use with an if conditional, i make an option that let me pause the music, if i activate it, the if creates an objects and while the file exists the music stop playing and if i push again the if erase the file and the music continues. i want that the raspberry erase that file if we have music paused so the music start on the startup and i can activate pause again in the menus.

          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.