From c19251bc366454d7b404385d0914b9b6ea232a03 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Fri, 16 Sep 2022 11:44:28 -0700 Subject: [PATCH] great stuff, patching in progress, finished noborder --- .gitignore | 5 +++++ config.h | 1 + dwm.1 | 10 ++++++++++ dwm.c | 31 +++++++++++++++++++++++++------ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f1b1972 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.o +*.orig +patches/ +dwm +dwm.1 diff --git a/config.h b/config.h index 12d6ba0..453924f 100644 --- a/config.h +++ b/config.h @@ -94,6 +94,7 @@ static const Key keys[] = { TAGKEYS( XK_8, 7) TAGKEYS( XK_9, 8) { MODKEY|ShiftMask, XK_q, quit, {0} }, + { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} }, }; /* button definitions */ diff --git a/dwm.1 b/dwm.1 index ddc8321..7b6cadb 100644 --- a/dwm.1 +++ b/dwm.1 @@ -142,6 +142,9 @@ Add/remove all windows with nth tag to/from the view. .TP .B Mod1\-Shift\-q Quit dwm. +.TP +.B Mod1\-Control\-Shift\-q +Restart dwm. .SS Mouse commands .TP .B Mod1\-Button1 @@ -155,6 +158,13 @@ Resize focused window while dragging. Tiled windows will be toggled to the float .SH CUSTOMIZATION dwm is customized by creating a custom config.h and (re)compiling the source code. This keeps it fast, secure and simple. +.SH SIGNALS +.TP +.B SIGHUP - 1 +Restart the dwm process. +.TP +.B SIGTERM - 15 +Cleanly terminate the dwm process. .SH SEE ALSO .BR dmenu (1), .BR st (1) diff --git a/dwm.c b/dwm.c index 60f0299..ce6536e 100644 --- a/dwm.c +++ b/dwm.c @@ -437,9 +437,15 @@ buttonpress(XEvent *e) } if (ev->window == selmon->barwin) { i = x = 0; - do + unsigned int occ = 0; + for(c = m->clients; c; c=c->next) + occ |= c->tags; + do { + /* Do not reserve space for vacant tags */ + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) + continue; x += TEXTW(tags[i]); - while (ev->x >= x && ++i < LENGTH(tags)); + } while (ev->x >= x && ++i < LENGTH(tags)); if (i < LENGTH(tags)) { click = ClkTagBar; arg.ui = 1 << i; @@ -725,13 +731,12 @@ drawbar(Monitor *m) } x = 0; for (i = 0; i < LENGTH(tags); i++) { + /* Do not draw vacant tags */ + if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) + continue; w = TEXTW(tags[i]); drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); - if (occ & 1 << i) - drw_rect(drw, x + boxs, boxs, boxw, boxw, - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, - urg & 1 << i); x += w; } w = TEXTW(m->ltsymbol); @@ -1281,12 +1286,26 @@ void resizeclient(Client *c, int x, int y, int w, int h) { XWindowChanges wc; + unsigned int n; + Client *nbc; c->oldx = c->x; c->x = wc.x = x; c->oldy = c->y; c->y = wc.y = y; c->oldw = c->w; c->w = wc.width = w; c->oldh = c->h; c->h = wc.height = h; wc.border_width = c->bw; + + for (n = 0, nbc = nexttiled(c->mon->clients); nbc; nbc = nexttiled(nbc->next), n++); + + if (c->isfloating || c->mon->lt[c->mon->sellt]->arrange == NULL) { + } else { + if (c->mon->lt[c->mon->sellt]->arrange == monocle || n == 1) { + wc.border_width = 0; + c->w = wc.width += c->bw * 2; + c->h = wc.height += c->bw * 2; + } + } + XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); configure(c); XSync(dpy, False);