clacker
Group: Members
Posts: 570
Joined: June 2004 |
|
Posted: May 23 2005,11:48 |
|
I was looking at replacing fluxbox with another window manager. Not so much because there is anything wrong with fluxbox, but because I was looking for something new and different. I was looking at keyboard binding, so I thought I'd give the keyboard binding in fluxbox a go and see what could be done.
The two things I wanted to do were:
1) Using the "Print Screen" key on my keyboard to take a snapshot of the whole screen without having to select anything
2) set up the windows keys to act something like the alt and control keys do, so that I could type <Windows> B and have a beaver application open.
The first thing I did was use a program called xev to find out if those keys were set to symbols already. When you type a character you get all sorts of info about a key, including it's name (if any) and its numeric value. You can see that the return key has the symble "Return" but the print screen and windows keys do not. Take a look at the output from the following to find unbound keys you can use:
cat /usr/X11R6/lib/X11/XKeysymDB | more
I chose SunPrint_Screen for my print screen button and IA1 and IA2 for the left an right windows keys. Next you need to make an input file for xmodmap, which will remap keys and set up the symbles for keys. Mine was called .Xmodmap and looked like this:
Code Sample | keycode 107 = SunPrint_Screen keycode 133 = IA1 keycode 134 = IA2 add mod5 = IA1 IA2 |
run xmodmap .Xmodmap (I did it from a terminal window in X). This sets the symble for 107 to SunPrint_Screen, and sets the two windows keys to return the symble mod5.
Now the easy part is making the keybinding in fluxbox. I added these lines to the front of my ~/.fluxbox/keys file:
Code Sample | None SunPrint_Screen :ExecCommand xwd -root > output.xwd Mod5 b :ExecCommand beaver Mod5 e :ExecCommand emelfm Mod5 t :ExecCommand rxvt -rv -fn fixed -cr yellow -T "Bash" -e /bin/bash |
Choose restart from the window manager menu, and your keys are ready for use.
|