.--------------------------------------------------. : Set up shortcuts in X to go to specific programs : : by Emanuel Berg, July 2015 : : : : moasenwood AT zoho DOT eu : : http://user.it.uu.se/~embe8573 : '--------------------------------------------------' This tutorial shows how to setup a shortcut in X, that will bring up a specific program window. This reduces or eliminates "iteration" between windows at each switch - simply put, this it is a faster, and more pleasant way to do it. All civilized window managers (WMs) can be interacted with using the program wmctrl(1). It should be in your repositories, so get it. It works like this: 1) Go to your X terminal (e.g., xterm(1)) and type $ xman &; xcalc & xman(1) and xcalc(1) should appear as two neat windows. Here, we use them for display purposes - there are better ways to do calculation and browse the man pages! 2) Type $ wmctrl -l If it works you should see something like this: 0x00a00013 0 nl106-137-147 Calculator 0x0080000e 0 nl106-137-147 xman If it doesn't work, it means your WM is incompatible with wmctrl - then this whole method won't work! But I don't think that will happen too often. By the way, here is a useful alias to be put in your shell's rc file: alias wins='wmctrl -l' 3) Type $ wmctrl -a xman The window of xman should now be put on top, focused! Now, try to get to xcalc the same way. But not exactly the same way! Remember the output of 'wins' - xcalc wasn't refered to as "xcalc" but as "Calculator", i.e. wmctrl acts on what appears in the *title bar* of the window of the program. Other than that it is the same as with xman. 4) Now install xbindkeys(1), and start it with $ xbindkeys Confirm that it runs with $ ps -e | grep xbindkeys Note: Later, to make it run each time you start X, put xbindkeys & in ~/.xinitrc 5) Last, in ~/.xbindkeysrc set up the shortcuts: "wmctrl -a Calculator" alt+k "wmctrl -a xman" alt+w 6) Perhaps one can refresh xbindkeys somehow - if you find out, tell me. If not, type $ pkill xbindkeys Confirm it doesn't run, then run it again. 7) Now hit Alt+k for xcalc, and Alt+w for xman! - fin - Examples of the files mentioned: http://user.it.uu.se/~embe8573/conf/.xbindkeysrc http://user.it.uu.se/~embe8573/conf/.xinitrc