aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h3
-rw-r--r--monsterwm.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/config.def.h b/config.def.h
index 3683ee5..81d7dec 100644
--- a/config.def.h
+++ b/config.def.h
@@ -65,7 +65,8 @@ static Key keys[] = {
{ MOD1|SHIFT, XK_b, switch_mode, {.i = BSTACK}},
{ MOD1|SHIFT, XK_g, switch_mode, {.i = GRID}},
{ MOD1|SHIFT, XK_f, switch_mode, {.i = FLOAT}},
- { MOD1|CONTROL, XK_q, quit, {NULL}},
+ { MOD1|CONTROL, XK_r, quit, {.i = 0}}, /* quit with exit value 0 */
+ { MOD1|CONTROL, XK_q, quit, {.i = 1}}, /* quit with exit value 1 */
{ MOD1|SHIFT, XK_Return, spawn, {.com = termcmd}},
{ MOD4, XK_j, moveresize, {.v = (int []){ 0, 25, 0, 0 }}}, /* move down */
{ MOD4, XK_k, moveresize, {.v = (int []){ 0, -25, 0, 0 }}}, /* move up */
diff --git a/monsterwm.c b/monsterwm.c
index 428a311..bb1795e 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -88,7 +88,7 @@ static void moveresize(const Arg *arg);
static void mousemotion(const Arg *arg);
static void next_win();
static void prev_win();
-static void quit();
+static void quit(const Arg *arg);
static void spawn(const Arg *arg);
static void swap_master();
static void switch_mode(const Arg *arg);
@@ -178,7 +178,7 @@ static int xerrorstart(Display *dis, XErrorEvent *ee);
* currdeskidx - which desktop is currently active
*/
static Bool running = True;
-static int wh, ww, currdeskidx, prevdeskidx;
+static int wh, ww, currdeskidx, prevdeskidx, retval;
static unsigned int numlockmask, win_unfocus, win_focus;
static Display *dis;
static Window root;
@@ -905,7 +905,8 @@ void propertynotify(XEvent *e) {
* to quit just stop receiving events
* run is stopped and control is back to main
*/
-void quit(void) {
+void quit(const Arg *arg) {
+ retval = arg->i;
running = False;
}
@@ -1161,7 +1162,7 @@ int main(int argc, char *argv[]) {
run();
cleanup();
XCloseDisplay(dis);
- return 0;
+ return retval;
}
/* vim: set expandtab ts=4 sts=4 sw=4 : */