dwm

[fork] dynamic window manager
Log | Files | Refs | README | LICENSE

commit e2346360ee60ba463a2988f9fa44591d77d64f07
parent 7ffdbced60ce7e00f096223598277e2a5ec85d48
Author: hhvn <dev@haydenvh.com>
Date:   Thu, 11 Mar 2021 00:10:32 +0000

config.h dwm.c: add exit code based quit/restart

Diffstat:
Mconfig.h | 3++-
Mdwm.c | 5++++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/config.h b/config.h @@ -69,7 +69,8 @@ static Key keys[] = { { MODKEY, XK_l, setmfact, {.f = +0.05 } }, { MODKEY, XK_p, incnmaster, {.i = -1 } }, { MODKEY, XK_q, killclient, {0} }, - { MODKEY|ShiftMask, XK_q, quit, {0} }, + { MODKEY|ShiftMask, XK_q, quit, {.i = 1} }, /* err value of 1 = quit */ + { MODKEY|ControlMask, XK_q, quit, {.i = 0} }, /* err value of 0 = restart */ { MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, diff --git a/dwm.c b/dwm.c @@ -197,6 +197,7 @@ static Client *nexttiled(Client *c); static void pop(Client *); static void propertynotify(XEvent *e); static void quit(const Arg *arg); +static void restart(const Arg *arg); static Monitor *recttomon(int x, int y, int w, int h); static void resize(Client *c, int x, int y, int w, int h, int interact); static void resizeclient(Client *c, int x, int y, int w, int h); @@ -276,6 +277,7 @@ static void (*handler[LASTEvent]) (XEvent *) = { }; static Atom wmatom[WMLast], netatom[NetLast]; static int running = 1; +static int exitval = 1; static Cur *cursor[CurLast]; static Clr **scheme; static Display *dpy; @@ -1310,6 +1312,7 @@ void quit(const Arg *arg) { running = 0; + exitval = arg->i; } Monitor * @@ -2164,7 +2167,7 @@ main(int argc, char *argv[]) run(); cleanup(); XCloseDisplay(dpy); - return EXIT_SUCCESS; + return exitval; } static void