From 0854099eab7d14ce53cf408f6413589b0e955029 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 1 May 2023 22:40:55 -0700 Subject: [PATCH] Add ability to reset with Super+Shift+r --- dwm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dwm.c b/dwm.c index 4f29d9b..a54bdc0 100644 --- a/dwm.c +++ b/dwm.c @@ -268,8 +268,10 @@ static int xerror(Display *dpy, XErrorEvent *ee); static int xerrordummy(Display *dpy, XErrorEvent *ee); static int xerrorstart(Display *dpy, XErrorEvent *ee); static void zoom(const Arg *arg); +static void restart(const Arg *arg); /* variables */ +static const char *exec_name; static Systray *systray = NULL; static const char broken[] = "broken"; static char stext[256]; @@ -2551,9 +2553,15 @@ zoom(const Arg *arg) pop(c); } +void +restart(const Arg *arg) { + execlp(exec_name, exec_name, NULL); +} + int main(int argc, char *argv[]) { + exec_name = argv[0]; if (argc == 2 && !strcmp("-v", argv[1])) die("dwm-"VERSION); else if (argc != 1)