diff --git a/speedwm.c b/speedwm.c index c150842..5c6d027 100644 --- a/speedwm.c +++ b/speedwm.c @@ -4752,6 +4752,7 @@ sortscreens(XineramaScreenInfo *screens, int n) void spawn(const Arg *arg) { + FILE *buttonfile = fopen("/tmp/speedwm-button", "w"); if (fork() == 0) { if (dpy) close(ConnectionNumber(dpy)); @@ -4761,6 +4762,14 @@ spawn(const Arg *arg) if (statuscmdn == statuscmds[i].id) { statuscmd[2] = statuscmds[i].cmd; setenv("BUTTON", lastbutton, 1); + int writestatus = fputs(lastbutton, buttonfile); + if (writestatus == EOF) { + fprintf(stderr, "speedwm: failed to write statuscmd button.\n"); + return; + } + + fclose(buttonfile); + break; } }