— layout: post title: “FineTune UI with Mouse Gestures: An alternative to Keyboard Shortcuts” date: 2011-08-31 comments: true categories: [‘GNU/Linux’] —
I usually don’t like writing tutorials about particular software which themselves are easy to use and self explaining, but this one is special. This post is dedicated to “Easystroke”, a gesture recognition program and a few more tiny-winy tweaks.
I don’t make a very innovative use of mouse and often use key-board shortcuts along with mouse to get work done fast and smoothly.
But, fortunately, day before yesterday I got my left hand hurt when I was working in farm. Due to injury I was unable to use keyboard and mouse at same time, so I started searching for an alternative to keyboard shortcuts.
Out of few solutions I came along with, most successful was Eastystroke. It quickly get integrated with  the user interface and is helping in fast recovery of my hand : )
So we shall start with our journey to tune up the UI as per our needs.

Installing EasyStroke:

On Debian and based systems (Ubuntu, Mint etc etc), use this command:
sudo apt-get install easystroke
On Fedora and based systems, use this command:
sudo yum install easystroke
I know you know that, so what ?
Plus it can always be downloaded from Souceforge.

Setting up Easystroke is a child play.
Coolest thing about easystroke is that we can assign mouse gestures not only a command, but also a keyboard shortcut. So we don’t need to know commands for assigning them to mouse gestures.
If you think I am just fooling around (and you know all commands), then guess what is command for maximizing the current window, shortcut is “alt+F10” (though it is possible to this with command line (using wmctrl) but, if we have an easier way, why to do any other way).

SO, all we have to do is to click “Add Action”, name the action, decide it to be a command or keyboard shortcut (or something else) and then assign the mouse gesture. And That’s it. All done.

Let’s tune it finely

There is huge heap of commands and shortcuts to be assigned, but be ware, don’t assign too much of them or things may go wrong anytime. Try it and you will know what I mean :P .
Here is a short list of frequently used shortcuts :

Maximize:                                                                 Alt + F10
Unmaximize:                                                             Alt + F5
Minimize:                                                                  Alt + F9
Close:                                                                        Alt + F4   (everyone knows that)
Show Desktop:                                                          Super + D

 And now some for our favorite Web Browser and Nautilus:

Back:                                                                                 Alt + Left
Forward:                                                                            Alt + Right
Open New Tab:                                                                 Ctrl + T
Close Tab:                                                                         Ctrl + W
Open recently closed Tab:                                                 Shift + Ctrl + T 
Next Tab :                                                                          Ctrl + PgDown
Previous Tab:                                                                     Ctrl + PgUp
All you have to do is assigning them to mouse movement of your choice.  

Google It 

Yes we can assign a gesture to search the selected text on Google. For this we need to install “xsel” (X selection from Command line):
sudo apt-get install xsel
Once installed, Add a new Action in Easystroke and set it to be a Command. In the Command Field enter this line:
 google-chrome “http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=`xsel -p | tr [:space:] +`”
Here google-chrome can be replaced with Firefox (if you are using that) and in case you don’t want to search it on Google it can be changed. As you’d have noticed, the basic syntax is:
Browser “URL”
 To fill in URL, search something on site of your choice (say Youtube) for “Test” and replace word “test” in the url (http://www.youtube.com/results?search_query=test&aq=f) with `xsel -p | tr [:space:] +`. 
Same can be done for Google Images, News, Videos, Yahoo etc etc. 

Bind the corners:

In addition to mouse gestures, there is one more thing I want to add. I am using it for a long time ( and most probably you too), I just wanted to add here. 

It is assigning the corners of screen to run specific commands. If you have experienced Gnome 3, you know what it mean. What we do is that we bind corners so that whenever mouse is moved to very the very corner, a certain command is run (it may be opening Web Browser or Home folder or something else).
If you are using Compiz than:

  1. Install “Compiz Fusion” and “Compizconfig Settings manager” from Synaptic Package manager. 
  2. Run Compiz configuration settings manager
  3. Search for “Commands” and enable it
  4. Enter commands in appropriate boxes
  5. Bind them with suitable edges under “Bind Edge” button.
In case you are not using Compiz, then you can install Bridgeside,

sudo apt-get install brightside

It is very simple to use and configure, so I will not explain it here : )

Hope you enjoyed this post. Thanks for visiting !! :)

Circle Beat Of The Geek on Google Plus
OR Like us on Facebook  OR Follow on Twitter