} color_t;
/* Global data */
+static int running;
static void *cache;
static Atom atoms[natoms];
static int (*xerrorxlib)(Display *, XErrorEvent *);
wm_update(); // For struts
/* Main loop */
- for(;;)
+ running = 1;
+ while (running)
{
XEvent ev;
XNextEvent(root->sys->dpy, &ev);
process_event(ev.type, &ev, root);
}
}
+
+void sys_exit(void)
+{
+ running = 0;
+}
#endif
if (key == key_f5) return wm_update(), 1;
if (key == key_f6) return print_txt(), 1;
+ if (key == 'q') return sys_exit(), 1;
}
/* Floating layer */
wm->tags = list_insert(NULL, wm->tag);
Key_t keys_e[] = {key_enter, key_focus};
- Key_t keys_s[] = {'h', 'j', 'k', 'l', ' ',
+ Key_t keys_s[] = {'h', 'j', 'k', 'l', 'q', ' ',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
Key_t keys_m[] = {'h', 'j', 'k', 'l', 'd', 's', 'm', 't', ' ',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',