nixos/suckless/dwm-patches/21-bar-width.diff
2022-09-30 14:46:28 -04:00

57 lines
2.4 KiB
Diff

diff --git a/config.def.h b/config.def.h
index 48917a6..ece0707 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,6 +12,7 @@ static const double activeopacity = 1.0f; /* Window opacity when it's focu
static const double inactiveopacity = 0.875f; /* Window opacity when it's inactive (0 <= opacity <= 1) */
static Bool bUseOpacity = True; /* Starts with opacity on any unfocused windows */
static const int user_bh = 0; /* 0 means that dwm will calculate bar height, >= 1 means dwm willcalculate bar height, >= 1 means dwm will user_bh as bar height */
+static const int barwidth = 250;
static const int focusonwheel = 0;
static const int vertpad = 10; /* vertical padding of bar */
static const int sidepad = 10; /* horizontal padding of bar */
diff --git a/dwm.c b/dwm.c
index 6f5e261..1de5526 100644
--- a/dwm.c
+++ b/dwm.c
@@ -740,13 +740,6 @@ drawbar(Monitor *m)
if (!m->showbar)
return;
- /* draw status first so it can be overdrawn by tags later */
- if (m == selmon) { /* status is only drawn on selected monitor */
- drw_setscheme(drw, scheme[SchemeNorm]);
- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
- drw_text(drw, m->ww - tw - 2 * sp, 0, tw, bh, 0, stext, 0);
- }
-
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
if (c->isurgent)
@@ -771,7 +764,7 @@ drawbar(Monitor *m)
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, w - 2 * sp, bh, 1, 1);
}
- drw_map(drw, m->barwin, 0, 0, m->ww, bh);
+ drw_map(drw, m->barwin, 0, 0, barwidth, bh);
}
void
@@ -1933,7 +1926,7 @@ togglebar(const Arg *arg)
{
selmon->showbar = !selmon->showbar;
updatebarpos(selmon);
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
+ XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, barwidth, bh);
arrange(selmon);
}
@@ -2069,7 +2062,7 @@ updatebars(void)
for (m = mons; m; m = m->next) {
if (m->barwin)
continue;
- m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, m->ww, bh, 0, depth,
+ m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, barwidth, bh, 0, depth,
InputOutput, visual,
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);