This doesn't really work yet -- it doesn't initialize graphics properly
Here are two scripts that let you "force" autorun to work even after quitting a program. Useful for gmenu2x. This should be used in place of the "Autorun" preference in the GPH default menu, so turn that off before installing these.
Run autoreallyrun-on first to set it up. Then you can go back and forth between autoreallyrun being on or off by running the two programs.
Please note: this is beta and may screw up your Wiz, forcing a reinstall from firmware. Use at your own risk!!. That said, it works for me. This works by copying your gp2xmenu executable off safely and replacing it with a shell script that boots your autorun.gpu file if it is accessible. So please be warned that a weird thing could happen that destroys your gp2xmenu executable. You can read the source, it's just two shell scripts, I'll even list them here. Any comments please let me know.
Here's the source of autoreallyrun-on and off, but it's easier if you just download the GPE files and put them on your Wiz.
Here are two scripts that let you "force" autorun to work even after quitting a program. Useful for gmenu2x. This should be used in place of the "Autorun" preference in the GPH default menu, so turn that off before installing these.
Run autoreallyrun-on first to set it up. Then you can go back and forth between autoreallyrun being on or off by running the two programs.
Please note: this is beta and may screw up your Wiz, forcing a reinstall from firmware. Use at your own risk!!. That said, it works for me. This works by copying your gp2xmenu executable off safely and replacing it with a shell script that boots your autorun.gpu file if it is accessible. So please be warned that a weird thing could happen that destroys your gp2xmenu executable. You can read the source, it's just two shell scripts, I'll even list them here. Any comments please let me know.
Here's the source of autoreallyrun-on and off, but it's easier if you just download the GPE files and put them on your Wiz.
Code:
#!/bin/sh
# autoreallyrun-on.gpe
# Check if we've already done the setup for this to work.
if [ -e /etc/autoreallyrun-setup ]; then
# We have, don't do anything
echo "Setup already done"
else
# Copy the existing gp2xmenu2x to gp2xmenu.old
cp /usr/gp2x/gp2xmenu /usr/gp2x/gp2xmenu.old
# write gp2xmenu.new with a shell script
cat > /usr/gp2x/gp2xmenu.new <<STOP
#!/bin/sh
# Check if there's an autorun file on the SD card (gmenu2x for example), if so, run it
if [ -e /mnt/sd/autorun.gpu ]; then
exec /mnt/sd/autorun.gpu
fi
# else exec the old menu
exec /usr/gp2x/gp2xmenu.old
STOP
# Set the "we've done the setup" bit
touch /etc/autoreallyrun-setup
fi
# Setup check done. Assume everything is ready to go:
# Copy gp2xmenu.new to gp2xmenu
cp /usr/gp2x/gp2xmenu.new /usr/gp2x/gp2xmenu
# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu
Code:
#!/bin/sh
# autoreallyrun-off.gpe
# Check if we've already done the setup for this to work.
if [ -e /etc/autoreallyrun-setup ]; then
# We have, don't do anything right now
echo "Setup already done"
else
# Exit. You need to run autoreallyrun-on first for this to do anything.
# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu
fi
# Otherwise, replace old and restart
# Copy gp2xmenu.old to gp2xmenu
cp /usr/gp2x/gp2xmenu.old /usr/gp2x/gp2xmenu
# return to the menu screen
cd /usr/gp2x
sync
exec /usr/gp2x/gp2xmenu
Last edited by a moderator: