X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=dwm.c;h=7a6c591e2e3347a66e13d52975343ab822e1ccb6;hb=e5a965a27480c8b27cfb4884cc8f4988924d1087;hp=1c52d805466ebaaf5e1c50ff7b74cc7e8462070b;hpb=c56533615f84df801f10dedc4d6ff267e0e8df0a;p=dwm.git diff --git a/dwm.c b/dwm.c index 1c52d80..7a6c591 100644 --- a/dwm.c +++ b/dwm.c @@ -51,6 +51,7 @@ #define LENGTH(x) (sizeof x / sizeof x[0]) #define MAXTAGLEN 16 #define MOUSEMASK (BUTTONMASK|PointerMotionMask) +#define SHCMD(cmd) { .v = (char*[]){ "/bin/sh", "-c", cmd, NULL } } #define TAGMASK ((int)((1LL << LENGTH(tags)) - 1)) #define TEXTW(x) (textnw(x, strlen(x)) + dc.font.height) @@ -363,8 +364,11 @@ checkotherwm(void) { void cleanup(void) { Arg a = {.i = ~0}; + Layout foo = { "", NULL }; + close(STDIN_FILENO); view(&a); + lt = &foo; while(stack) unmanage(stack); if(dc.font.set) @@ -1476,7 +1480,9 @@ togglefloating(const Arg *arg) { void togglelayout(const Arg *arg) { - if(++lt == &layouts[LENGTH(layouts)]) + if(arg->v) + lt = (Layout *)arg->v; + else if(++lt == &layouts[LENGTH(layouts)]) lt = &layouts[0]; if(sel) arrange();