2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
8 #include <X11/keysym.h>
10 static const char *term[] = {
11 "xterm", "-bg", "black", "-fg", "white", "-fn",
12 "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", 0
15 static const char *proglist[] = {
16 "sh", "-c", "exec `ls -lL /bin /sbin /usr/bin /usr/local/bin 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort | uniq | gridmenu`", 0
20 { Mod1Mask, XK_Return, run, term },
21 { Mod1Mask, XK_p, run, proglist },
22 { Mod1Mask | ShiftMask, XK_c, kill, NULL},
23 { Mod1Mask | ShiftMask, XK_q, quit, NULL},
32 len = sizeof(key) / sizeof(key[0]);
33 for(i = 0; i < len; i++) {
34 code = XKeysymToKeycode(dpy, key[i].keysym);
35 XUngrabKey(dpy, code, key[i].mod, root);
36 XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync);
43 XKeyEvent *ev = &e->xkey;
47 keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
48 len = sizeof(key) / sizeof(key[0]);
49 for(i = 0; i < len; i++)
50 if((keysym == key[i].keysym) && (key[i].mod == ev->state)) {
52 key[i].func(key[i].aux);