Power User 2011: Running scripts on your N9/N950 with MyMoves

Hi all!

In case you use MyMoves, here’s a fun thing to play with: running Python & shell scripts with gestures 🙂

For this you will need to have the developer mode enabled. I’m also going to assume you’ve already got Python for Harmattan already installed.

Running shell scripts with MyMoves
Say, you’ve got a useful shell script at /home/user/MyDocs/myscript.sh. Let’s run that using MyMoves gestures:

1. Edit /home/user/.config/mymoves.conf
2. Replace the line of the gesture of your choice. I’m going to use the ‘swipe up with two fingers’ gesture for this example, which is the row beginning with d0 in mymoves.conf

Put this into that line:
d0###MyScript###/usr/bin/aegis-exec -s -u user -l ‘/usr/bin/meego-terminal -n -e sh /home/user/MyDocs/myscript.sh’

3. Make sure to edit myscript.sh and insert a pausing row to the end of the script, so the Terminal window won’t just close immediately:

read -p ‘Press a key to continue…’

4. Go to MyMoves configuration UI, press ‘Stop Observing’ and after that ‘Start observing’, so the updated mymoves.conf is loaded.
5. Swipe!

Running Python scripts with MyMoves
Python scripts work exactly the same way, except you pass the -i parameter to the Python shell so it won’t close the Terminal window after the script is run.

So, for e.g. a script in /home/user/MyDocs/myscript.py, do the mymoves.conf editing as above, but add a line like this:

d0###MyPythonScript###/usr/bin/aegis-exec -s -u user -l ‘/usr/bin/meego-terminal -e /usr/bin/python -i /home/user/MyDocs/myscript.py’

Then just press ‘Stop Observing’ and ‘Start Observing’ in the MyMoves UI, and you’re ready to use the script.

About sandst1
A technology-oriented guy interested in all-round creativity, be it music, art, or putting software together for creating something new and expressing oneself

One Response to Power User 2011: Running scripts on your N9/N950 with MyMoves

  1. Pingback: Power User 2011:Running Scripts on your Nokia N9/N950 with MyMoves

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: