Skip to content

Commit

Permalink
Added dwm restart option.
Browse files Browse the repository at this point in the history
  • Loading branch information
JNRowe committed Jan 16, 2013
1 parent 0982be5 commit b053af9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.def.h
Expand Up @@ -106,6 +106,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_r, quit, {.i = +1 } },
};

/* button definitions */
Expand Down
5 changes: 5 additions & 0 deletions dwm.c
Expand Up @@ -305,6 +305,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
};
static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
static Bool running = True;
static Bool restart = False;
static Cursor cursor[CurLast];
static Display *dpy;
static DC dc;
Expand Down Expand Up @@ -1745,6 +1746,8 @@ propertynotify(XEvent *e) {

void
quit(const Arg *arg) {
if(arg->i)
restart = True;
running = False;
}

Expand Down Expand Up @@ -2809,6 +2812,8 @@ main(int argc, char *argv[]) {
setup();
scan();
run();
if(restart)
execvp(argv[0], argv);
cleanup();
XCloseDisplay(dpy);
return EXIT_SUCCESS;
Expand Down

0 comments on commit b053af9

Please sign in to comment.