piggyback script off the screensaver?
-
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
-
-
You can use the event scripting support in EmulationStation and run your script on the
screensaver-start
event. See here for details. -
@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?
-
@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.
-
@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 python3sudo mpg123 -CONT
python3 /path/to/oled/script.sh &
python3 /path/to/light/scripts.sh &
-
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 needsudo
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) ?
-
@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 -
@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.
-
@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
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.