From 9dfeac09afe43566171f1778a40f96301c5e856c 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..340827c 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) { + execl(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)