diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-03-01 19:36:35 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-12-16 02:11:13 +0200 |
| commit | d93a13f4261d4ab183715cc6157a72ac1187ead9 (patch) | |
| tree | 31db2e29c3980b155bebdb5e6fb17ce5c700b7aa | |
| parent | 946c57212c5456786306525f59c479a8a357a7de (diff) | |
exit with specified value
| -rw-r--r-- | config.def.h | 3 | ||||
| -rw-r--r-- | monsterwm.c | 9 |
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 : */ |
