Tuesday, January 18, 2011

How to switch running applications with command line.

On windows Microsoft system, if we want to switch to other application we usually click on taskbar. But in Linux environment, we can also click on panel(taskbar) or we can use command to switch to other applications. In this tutorial I will show you how to use command line to switch application.

1. download "wmctrl" http://tomas.styblo.name/wmctrl/dist/wmctrl-1.07.tar.gz
2. Install this software (you can use ./configure --> make --> make install) or you can read the software document.
3. Now let start to use the wmctrl

to list all running applications we use
#wmctrl -l 

0x0080006a -1 localhost panel
0x0180007c  0 localhost Mozilla Firefox
0x02600007  3 localhost user@localhost: /home/user - Shell - Konsole
0x00600011  1 localhost KTorrent
0x02200007  0 localhost user@localhost: /home/user - Shell - Konsole
a           b c         d
The columns:
          a. window ID.
          b. desktop ID.
          c. client machine
          d. name (long title) of the window.
4. now if i want to switch to "firefox", I can type "#wmctrl -a fire", or to Ktorrent I can type "wmctrl -a torre"
NOTE: a. We don't type this symbol "# ", It is just to show the start of command line.
            b.  wmctrl is case insensitive and we don't have to type the whole name.

No comments:

Post a Comment