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

    piggyback script off the screensaver?

    Scheduled Pinned Locked Moved Help and Support
    lights
    9 Posts 2 Posters 919 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.
    • M
      majikill
      last edited by

      i am working on a dynamic lighting setup for my retropie and was wondering if it would be possible to piggyback a script off the screensaver. or if there is a way to setit up to run said script 5 mins after last input

      1 Reply Last reply Reply Quote 0
      • mituM mitu moved this topic from Ideas and Development on
      • mituM
        mitu Global Moderator
        last edited by

        You can use the event scripting support in EmulationStation and run your script on the screensaver-start event. See here for details.

        M 1 Reply Last reply Reply Quote 0
        • M
          majikill @mitu
          last edited by

          @mitu thank you yet again for the help. i was able to get the dynamic lighting to work. the oled screen on the other hand, will not display anything when screensaver-stop is invoked. tells me adafruit_ssd1306 isnt found. its legit the only instance it throws this moduelnotfound error. i could f4 into the terminal and type in the python command exactly as i have it in the script and no module error. is there some kind of permission thing im missing here?

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

            @majikill said in piggyback script off the screensaver?:

            tells me adafruit_ssd1306 isnt found. its legit the only instance it throws this moduelnotfound error. i could f4 into the terminal and type in the python command exactly as i have it in the script and no module error. is there some kind of permission thing im missing here?

            Are you running the commands as the same user ? Post more details about your ES script and how you're calling the python script.

            M 1 Reply Last reply Reply Quote 0
            • M
              majikill @mitu
              last edited by majikill

              @mitu i think so? my screensaver-stop stop script is basic as they come but it looks kinda like this
              #! /bin/bash
              #used to clear previous script
              sudo killall python3

              sudo mpg123 -CONT

              python3 /path/to/oled/script.sh &

              python3 /path/to/light/scripts.sh &

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

                python3 /path/to/oled/script.sh &
                python3 /path/to/light/scripts.sh &

                Are you using python3 to run a .sh script ? Isn't this an error ?
                Btw, you don't need sudo to run a music player or stop a process that you've started as a simple user.

                What are the permissions on the script itself (the one you posted earlier) ?

                M 1 Reply Last reply Reply Quote 0
                • M
                  majikill @mitu
                  last edited by

                  @mitu you are correct, i was mistaken with the python3 for .sh files, been a long night.
                  those scripts point to other shell scripts that run the python scripts properly. the permissions are wide open but i will chmod777 it to be certain

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

                    @majikill said in piggyback script off the screensaver?:

                    the permissions are wide open but i will chmod777 it to be certain

                    Don't do that, it's a bad practice and this may actually prevent the script from running - due a EmulationStation bug (see this topic). Check the permissions and make sure they report 755 on the script.

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      majikill @mitu
                      last edited by

                      @mitu ah ok good to know. I ended up using luma oled drivers that dont depend on the adafruit driver and they are working out nicely as screensavers for the oled screen. I will eventually have to revisit this issue because of the plans i have for the project but this has been very helpful. I now need to figure out how to launch a clear command for the screen just before shutdown to prevent burn in. The script i originally needed help with launches shut off commands for the multiple led hats and devices when the screensaver starts , including a 30min auto shutdown command. But when the pi shuts down though the oled keeps the pixels it was displaying last so lets hope the service im going to write works. Again thank you for your help as always

                      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.