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)