diff -ruN orig/dwm-5.3.1/config.def.h dwm-5.3.1/config.def.h --- orig/dwm-5.3.1/config.def.h 2008-12-06 10:33:03.000000000 +0100 +++ dwm-5.3.1/config.def.h 2008-12-09 20:12:45.000000000 +0100 @@ -80,7 +80,8 @@ TAGKEYS( XK_7, 6) TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) - { MODKEY|ShiftMask, XK_q, quit, {0} }, + { MODKEY|ShiftMask, XK_q, quit, {.i = 0 } }, + { MODKEY|ShiftMask|ControlMask, XK_q, quit, {.i = 1 } }, }; /* button definitions */ diff -ruN orig/dwm-5.3.1/dwm.c dwm-5.3.1/dwm.c --- orig/dwm-5.3.1/dwm.c 2008-12-06 10:33:03.000000000 +0100 +++ dwm-5.3.1/dwm.c 2008-12-08 20:33:16.000000000 +0100 @@ -23,6 +23,7 @@ * * To understand everything else, start reading main(). */ +#define _GNU_SOURCE #include #include #include @@ -238,6 +240,7 @@ static DC dc; static Layout *lt[] = { NULL, NULL }; static Window root, barwin; +static char **args; /* configuration, allows nested code to access above variables */ #include "config.h" @@ -1026,6 +1032,8 @@ void quit(const Arg *arg) { + if(arg->i) /* restart dwm, if fails just fall through and exit */ + execve(args[0], args, environ); readin = running = False; } @@ -1733,6 +1741,7 @@ if(!(dpy = XOpenDisplay(0))) die("dwm: cannot open display\n"); + args = argv; checkotherwm(); setup(); scan();