EVIL WINDOWS KEY This document describes how to hack evilwm so it uses the -evil- windows key present in 99% of PC keyboards to cycle through windows. Based on this information, you can hack further evilwm and assign actions to the right windows key and to the menu key. First, you have to discover which is the keycode of this key. In most systems it should be 115. However, you can run the following program which will print out the keycode of each key pressed in the tiny window it creates. The program is compiled with: gcc -lX11 -L /usr/X11R6/lib you_name_it.c ---------------------------------------------------------------- #include #include #include #include #include #include #include int main () { Display *D; Window W; if (!(D = XOpenDisplay (NULL))) return -1; XSetWindowAttributes attr; attr.backing_store = Always; W = XCreateWindow (D, DefaultRootWindow (D), 0, 0, 200, 200, 1, CopyFromParent, CopyFromParent, CopyFromParent, CWBackingStore, &attr); XMapWindow (D, W); XFlush (D); XSelectInput (D, W, KeyPressMask); XEvent event; for (;;) { XNextEvent (D, &event); switch (event.type) { case KeyPress: printf ("KEY PRESS %i!!\n", event.xkey.keycode); } } } ---------------------------------------------------------------- When you find the keycode of the left windows key, edit your .xinitrc (or whichever file you use to start evilwm) and add the following entry: xmodmap -e "keycode 115 = F13" This will make the windows key act as function key F13. Then you have to hack evilwm to make it cycle through windows when F13 is pressed. 1) Edit the file keymap.h and change: -#define KEY_NEXT XK_Tab +#define KEY_NEXT XK_F13 2) Edit the file main.c and change: - grab_keysym(screens[i].root, Mod1Mask, XK_Tab); + grab_keysym(screens[i].root, 0, KEY_NEXT); Then "make clean; make" and Voila!!!!!!!!!!!!!!!!!!! CENTERING THE WINDOWS Ok, so you have a 800x600 screen but the virtual screen is actually 1600x1200 and when you cycle to the next window the pointer goes at the bottom right corner and 99% of your window is out of screen. Hack evilwm to include the entire window in the screen. Edit the file screen.c Find the line: setmouse(newc->window, newc->width + newc->border - 1, newc->height + newc->border - 1); Just above this one add the line: setmouse(newc->window, 0, 0); and "make clean; make".