Ubuntu Multi-Touch Gestures on the Lenovo S10-3t

March 4, 2011 Posted by admin

The script below will get you from a clean install of Ubuntu Netbook 10.10 to multi-touch gestures like illustrated below.  You will of course need Compiz for the cool effects.  I will not go over installing Compiz here since there are a myriad of sources on the web.  I will just direct you here (http://ranjith.zfs.in/install-compiz-fusion-ubuntu-10-10-maverik-meerkat/) for the time being.

If you want to do the process manually just use the script as a guide. Use at your own risk.

#!/bin/sh
echo --------------------------------------------------------------
echo Installing New Kernel
echo --------------------------------------------------------------
echo -n Downloading kernel...
workdir=$(pwd)
cd /tmp
# 32-bit only
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-rc2-maverick/linux-headers-2.6.37-020637rc2-generic_2.6.37-020637rc2.201011160905_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-rc2-maverick/linux-headers-2.6.37-020637rc2_2.6.37-020637rc2.201011160905_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.37-rc2-maverick/linux-image-2.6.37-020637rc2-generic_2.6.37-020637rc2.201011160905_i386.deb
echo [done]
echo -n Installing headers and kernel...
sudo dpkg -i linux-headers-2.6.37-020637rc2-generic_2.6.37-020637rc2.201011160905_i386.deb linux-headers-2.6.37-020637rc2_2.6.37-020637rc2.201011160905_all.deb linux-image-2.6.37-020637rc2-generic_2.6.37-020637rc2.201011160905_i386.deb
echo [done]

echo --------------------------------------------------------------
echo Installing utouch
echo --------------------------------------------------------------
sudo add-apt-repository ppa:utouch-team/utouch
sudo apt-get update
sudo apt-get -y install utouch

echo --------------------------------------------------------------
echo Installing ginn from source
echo --------------------------------------------------------------
# Installing ginn dependencies
sudo apt-get -y build-dep ginn
cd /tmp
wget http://launchpad.net/ginn/0.x/0.2.4/+download/ginn-0.2.4.tar.gz
sudo tar xvzf /tmp/ginn-0.2.4.tar.gz -C /usr/src/
cd /usr/src/ginn-0.2.4
./configure
sudo make
sudo make install
sudo mkdir /etc/ginn
sudo cp /usr/src/ginn-0.2.4/etc/wishes.xml /etc/ginn/
echo --------------------------------------------------------------
echo Run ginn from the terminal to start multitouch support.
echo Modify the /etc/ginn/wishes.xml file to configure gestures.
echo --------------------------------------------------------------

Here is a demonstration wishes.xml file that will configure the gestures as in the video above.  Copy and paste this content into a new file /etc/ginn/demo-wishes.xml.  Then launch ginn from the terminal using the command “ginn /etc/ginn/demo-wishes.xml”.

<ginn>
  <global>
<!-- Application control -->
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta y" min="20" max="80"/>
        <key>Down</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta y" min="-80" max="-20"/>
        <key>Up</key>
      </action>
    </wish>

<!-- Windows control -->
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <key modifier1="Alt_L">F10</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <key modifier1="Alt_L">F10</key>
      </action>
    </wish>

<!-- System wide - control desktop  -->
    <wish gesture="Tap" fingers="2">
      <action name="action1" when="update">
        <trigger prop="tap time" min="20" max="400"/>
        <key modifier1="Super_L">E</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action4" when="update">
        <trigger prop="radius delta" min="-80" max="-50"/>
        <key modifier1="Super_L">W</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action3" when="finish">
        <trigger prop="delta x" min="40" max="600"/>
        <key modifier1="Control_L" modifier2="Alt_L">Left</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action4" when="finish">
        <trigger prop="delta x" min="-600" max="-40"/>
        <key modifier1="Control_L" modifier2="Alt_L">Right</key>
      </action>
    </wish>
  </global>

<!-- Applications specific gestures  -->
  <applications>
    <application name="inkscape">
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <key>KP_Subtract</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <key>KP_Add</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta x" min="20" max="80"/>
        <key modifier1="Control_L">Left</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta x" min="-80" max="-20"/>
        <key modifier1="Control_L">Right</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta y" min="20" max="80"/>
        <key modifier1="Control_L">Up</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta y" min="-80" max="-20"/>
        <key modifier1="Control_L">Down</key>
      </action>
    </wish>
    </application>

    <application name="evince">
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta y" min="20" max="80"/>
        <key>Page_Up</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta y" min="-80" max="-20"/>
        <key>Page_Down</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <key>KP_Subtract</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <key>KP_Add</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta x" min="20" max="80"/>
        <key>Left</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta x" min="-80" max="-20"/>
        <key>Right</key>
      </action>
    </wish>
    <wish gesture="Rotate" fingers="2">
      <action name="rotatecw" when="finish">
        <trigger prop="angle delta" min="0.08" max="1.5"/>
	<key modifier1="Control_L">Right</key>
      </action>
    </wish>
    <wish gesture="Rotate" fingers="2">
      <action name="rotateccw" when="finish">
        <trigger prop="angle delta" min="-1.5" max="-0.08"/>
	<key modifier1="Control_L">Left</key>
      </action>
    </wish>
    </application>

    <application name="Okular">
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <key modifier1="Control_L">KP_Subtract</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <key modifier1="Control_L">KP_Add</key>
      </action>
    </wish>
    </application>

    <application name="openoffice.org-writer">
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <button modifier1="Control_L">4</button>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <button modifier1="Control_L">5</button>
      </action>
    </wish>
    </application>

    <application name="eog">
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <key>KP_Subtract</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <key>KP_Add</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta y" min="20" max="80"/>
        <key>Page_Up</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta y" min="-80" max="-20"/>
        <key>Page_Down</key>
      </action>
    </wish>
    <wish gesture="Rotate" fingers="2">
      <action name="rotatecw" when="finish">
        <trigger prop="angle delta" min="0.08" max="1.5"/>
	<key modifier1="Control_L">R</key>
      </action>
    </wish>
    <wish gesture="Rotate" fingers="2">
      <action name="rotateccw" when="finish">
        <trigger prop="angle delta" min="-1.5" max="-0.08"/>
	<key modifier1="Control_L" modifier2="Shift_L">R</key>
      </action>
    </wish>
    </application>
    <application name="fennec">
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="-200" max="-40"/>
        <key modifier1="Control_L">Down</key>
      </action>
    </wish>
    <wish gesture="Pinch" fingers="2">
      <action name="action1" when="update">
        <trigger prop="radius delta" min="40" max="200"/>
        <key modifier1="Control_L">Up</key>
      </action>
    </wish>
    </application>

    <application name="firefox">
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta y" min="20" max="80"/>
        <key>Page_Up</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta y" min="-80" max="-20"/>
        <key>Page_Down</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action5" when="update">
        <trigger prop="delta x" min="20" max="80"/>
        <key>Left</key>
      </action>
    </wish>
    <wish gesture="Drag" fingers="2">
      <action name="action6" when="update">
        <trigger prop="delta x" min="-80" max="-20"/>
        <key>Right</key>
      </action>
    </wish>
    </application>

  </applications>
</ginn>

After playing with the demo-wishes.xml you will realize why it is only a demo. You will need to spend some time configuring your own wishes.xml to meet your needs.

It is still very cool, so have fun!

One Response to Ubuntu Multi-Touch Gestures on the Lenovo S10-3t

  1. marek says:

    Hey,
    it is possible to make ginn simulate Adobe Flash native multitouch gestures? I have big problem to make it works :(

  2. admin says:

    lehab,

    This information was obtained from “man ginn”.

    The names of keys list can be obtained after removing the XK_ prefix from /usr/include/X11/keysymdef.h file

    The mouse buttons are written with their corresponding number 1 Left Button
    2 Middle Button
    3 Right Button
    4 Wheel Up
    5 Wheel Down
    6 Horizontal Wheel Left
    7 Horizontal Wheel Right
    8 “Back” in browsers

    I hope this answers your question.

  3. lehab says:

    big thank`s for man.

    can you explain where from you get these values from demo-wishes.

    i want to understand how it works, and make my own, with black-jack and ******.

    p.s. sory for my english, i`m from russia.

Leave a Reply to admin Cancel reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

css.php