Everything that you will now read is what began as what was termed by the developer sandst1 as a small 3-day home hackathon:
It’s a thing called MyMoves. MyMoves is an attempt to bring configurable
gestures to Harmattan, written in QML/C++. The idea of MyMoves is to be able
to create a gesture, and attach an arbitrary shell command into it.
The current prototype of MyMoves consists of two parts:
- Mymoveserver, handles the touch events via XRecord, saves the gestures and performs the recognition
- Configuration UI for adding new gestures and starting/stopping the gesture observation
The server is controlled by the configuration UI via D-Bus commands
So. What on earth can we do with this? Let’s take a closer look. Here’s the configuration UI:
It consists of three buttons: “New Move“, “Start observing gestures“, and “Stop observing“.
The first thing to do is to is to create new gestures. Pressing “New Move” shows the screen for adding a gesture
It’s a very simple screen with a box where you draw the gesture (it’s a QmlCanvas btw)
and buttons for saving and clearing the gesture box. Here’s one drawn gesture:
Let’s take a look at the video on how adding gestures goes:
which currently means getting dirty with the terminal. The gestures are saved
into files called mymoves[number] under /home/user/MyDocs/moves. Each
gesture has the shell command and the gesture data, so the start of a gesture file looks
something like this:
Add your command here
-128 430
-105 436
-95 441
-76 447
-57 455
-38 460
-21 466
-2 474
14 479
Now we can just edit the file, and add the command we want to run
on that specific gesture, let’s say e.g. the calendar, so we replace
Add your command here
with
/usr/bin/invoker –no-wait –type=m /usr/bin/organiser -showWindow 1 &
The command needs to be added just like to a command to a terminal, so no quotes.
Make sure to add & to the end of the command, so it’ll start in a non-blocking way.
Also, the MyDocs folder is in users possession, so use su – user to get permissions for editing the files.
Do that for each of the mymoves[number] files, and you’re set up!
Now using the gestures is as simple as firing up MyMoves and pressing “Start observing gestures“.
Here’s MyMoves in action:
Enough for the talking! Where can I get it?
Source code: http://gitorious.org/mymoves
Harmattan debs: http://koti.kapsi.fi/~sh8dfwk/mymoves
Installation only via command line. SSH to your phone, copy the .debs under /home/user/MyDocs,
and run dpkg -i mymoveserver_0_0_1_armel.deb mymoves_0_0_1_armel.deb.
Plans for the future:
– Making the server more robust
– Decoupling the server from the configuration UI so that it starts from the boot
– A usable UI for configuring everything (such as dialogs for selecting an application to run on a gesture etc)
– anything else that pops into my mind
Source Expr3ss Yourself