Hello. I want to share my patch that I have been using for couple months that simplifies reconfiguring of the dwm. It adds function to execute into another executable, be it another build of dwm or another window manager.
I have following lines in `dwm.h': static const char *dwmcmd[] = {"dwm", NULL }; static const Key keys[] = { <...snip...> {MODKEY | ShiftMask, XK_r, exec, {.v = dwmcmd}}, <...snip...> Exec'ing loses manual window arrangement (window arrangement gets reset to one according to `rules', but I don't need to restart X, which is much more annoying. I think usefulness/complexity ratio is good enough to include this patch into dwm main release.
>From fa5f13e0c2e17de070968c335f47f5b123f39261 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov <seren...@kaction.cc> Date: Wed, 22 Feb 2023 17:02:48 -0500 Subject: [PATCH] dwm: add support of execing into another window manager --- dwm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dwm.c b/dwm.c index 253aba7..1cd3396 100644 --- a/dwm.c +++ b/dwm.c @@ -207,6 +207,7 @@ static void seturgent(Client *c, int urg); static void showhide(Client *c); static void sigchld(int unused); static void spawn(const Arg *arg); +static void exec(const Arg *arg); static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *m); @@ -1636,6 +1637,12 @@ sigchld(int unused) while (0 < waitpid(-1, NULL, WNOHANG)); } +void +exec(const Arg *arg) +{ + execvp(((char **)arg->v)[0], (char **)arg->v); +} + void spawn(const Arg *arg) { -- If possible, please keep mailing list in CC. It is public.