View Single Post
Flandry's Avatar
Posts: 1,559 | Thanked: 1,786 times | Joined on Oct 2009 @ Boston
#369
Here's a modified script. You'll want to test that the sed commands work as intended as i haven't done so. This script could be included in your tarball and simlinked as a different command like mupen64-accel or whatever.

Code:
#! /bin/sh

# See if accelemymote is installed ...
if [ ! -f /opt/maemo/usr/bin/accelemymote ]; then
        echo Accelemymote is not installed!
        exit
fi
# ... and not running. Start it up if so...
if [ ! -f /home/user/.accelemymote/live-trigger ]; then
        touch /home/user/.accelemymote/live-trigger
        /opt/maemo/usr/bin/accelemymote &

        # Enable accelerometer control in config file
        sed -i 's/\(device=\)\(-2\)/\10/' ~/.mupen64plus/blight_input.conf
        # Run emu
        /usr/bin/mupen64plus $1

        # Okay, now done so kill accelemymote and reset config file
        rm  /home/user/.accelemymote/live-trigger
        sed -i 's/\(device=\)\(0\)/\1-2/' ~/.mupen64plus/blight_input.conf

else # accelemymote appears to be already running
        echo Accelemymote appears to be running already. If not, type "rm /home/user/.accelemymote/live-trigger".
fi
Any questions?
__________________

Unofficial PR1.3/Meego 1.1 FAQ

***
Classic example of arbitrary Nokia decision making. Couldn't just fallback to the no brainer of tagging with lat/lon if network isn't accessible, could you Nokia?
MAME: an arcade in your pocket
Accelemymote: make your accelerometer more joy-ful
 

The Following User Says Thank You to Flandry For This Useful Post: