[SOLVED] Variables with runcommand-onstart.sh
-
Here is a proof:
$ time find /usr -type f -print -quit /usr/i686-w64-mingw32/bin/ar.exe real 0m0.266s user 0m0.000s sys 0m0.140s $ time find /usr -type f | head -1 /usr/i686-w64-mingw32/bin/ar.exe real 0m2.093s user 0m0.140s sys 0m0.403s
(Yeah, I'm not using an actual Linux system. It's Cygwin running on Windows. But the test is valid anyway.)
-
Nice find! I'm away on a business trip for the next two weeks and had to leave my Pi at home so I am hoping to find a way to mess with some scripts while it's inaccessible.
I have Googled emulating a Pi in a VM but it doesn't seem like anyone's done that, just approximated things with installing Debian.
-
@obsidianspider
This is right up my ally. I actually want to do something similar to this, but with something like a 20x2 LCD to just display the system and game title.
However, I might want to get an OLED screen for displaying the information.
I might ask you for some help setting up my own script..
My only thing is that I will then need to make a custom case to hold the Pi, as well as the screen and keep it all clean. -
@Nathan1031982 The script he posted above gives a good direction to your script.
The runcommand wiki can give some inspiration too: https://github.com/retropie/retropie-setup/wiki/runcommand#runcommand-onstart-and-runcommand-onend-scripts -
This is a very old topic, but I wanted to throw my script in so you can edit it to your liking. I don't have an Adafruit display, so I had to do some tinkering but you've all done the heavy lifting. Here are the minor edits for using a 3.5" display with fbi. Make sure you have the system.jpg images in the correct system rom folders.:
# /opt/retropie/configs/all/runcommand-onstart.sh # get the full path filename of the ROM rom=$3 # rom_bn receives $rom excluding everything from the first char to the last slash '/' rom_bn="${rom##*/}" # rom_bn receives $rom_bn excluding everything from the last char to the first dot '.' rom_bn="${rom_bn%.*}" # get the system name system=$1 # set the image file to the first result matching the ROM name - accounts for various possible file extensions img="$(find "/opt/retropie/configs/all/emulationstation/downloaded_images/${system}" -type f -name "${rom_bn}-image.*" | head -1)" # check to see if there was a file found (length of the file name not zero), if not, use an image based on system if [[ -z "${img}" ]]; then img="/opt/retropie/configs/all/emulationstation/downloaded_images/$system/$system.jpg" fi # run the python script to display the image sudo fbi -T 2 -d /dev/fb1 -noverbose -a "$img"
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.