aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2023-01-31 08:29:47 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2023-01-31 08:29:47 -0500
commit593e3c3847a721afd3c7d88767037a7b13132a11 (patch)
treec822cf06e6fc78dab31d2f74e6911840d4150af9
parent712d6639ff8e863560328131bbb92b248dc9cde7 (diff)
downloaddwm-593e3c3847a721afd3c7d88767037a7b13132a11.tar.gz
dwm-593e3c3847a721afd3c7d88767037a7b13132a11.tar.xz
On the fly restart
-rw-r--r--config.def.h1
-rw-r--r--dwm.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index 9efa774..aed3eb3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -94,6 +94,7 @@ static const Key keys[] = {
TAGKEYS( XK_7, 6)
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_r, restart, {0} },
{ MODKEY|ShiftMask, XK_q, quit, {0} },
};
diff --git a/dwm.c b/dwm.c
index c2bd871..8bcf0da 100644
--- a/dwm.c
+++ b/dwm.c
@@ -142,6 +142,7 @@ typedef struct {
} Rule;
/* function declarations */
+static void restart(Arg *arg);
static void applyrules(Client *c);
static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
static void arrange(Monitor *m);
@@ -275,6 +276,14 @@ static Window root, wmcheckwin;
struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
/* function implementations */
+
+void
+restart(const Arg *arg)
+{
+ char *a[] = {"dwm", NULL};
+ execvp(a[0], a);
+}
+
void
applyrules(Client *c)
{