sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 6818a7fad74cb2534c0b93f13d0c9e5774f8ff2d
parent 15e48815ea14e3574ebc9673de32fb7139b11c25
Author: iressa <iressa@bgsu.edu>
Date:   Sun,  7 Jun 2020 10:30:53 -0400

[dwm] Adding a patch staticstatus that keeps your status bar in one place when you use a multi-monitor setup, no matter where your focus is.

Diffstat:
Adwm.suckless.org/patches/staticstatus/dwm-staticstatus-6.2.diff | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/staticstatus/index.md | 19+++++++++++++++++++
2 files changed, 79 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/staticstatus/dwm-staticstatus-6.2.diff b/dwm.suckless.org/patches/staticstatus/dwm-staticstatus-6.2.diff @@ -0,0 +1,60 @@ +diff --git a/dwm.c b/dwm.c +index 9fd0286..d6eb701 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -266,7 +266,7 @@ static Cur *cursor[CurLast]; + static Clr **scheme; + static Display *dpy; + static Drw *drw; +-static Monitor *mons, *selmon; ++static Monitor *mons, *selmon, *statmon; + static Window root, wmcheckwin; + + /* configuration, allows nested code to access above variables */ +@@ -703,7 +703,7 @@ drawbar(Monitor *m) + Client *c; + + /* draw status first so it can be overdrawn by tags later */ +- if (m == selmon) { /* status is only drawn on selected monitor */ ++ if (m == statmon) { /* status is only drawn on user-defined status monitor */ + drw_setscheme(drw, scheme[SchemeNorm]); + tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ + drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); +@@ -1879,7 +1879,7 @@ updategeom(void) + else + mons = createmon(); + } +- for (i = 0, m = mons; i < nn && m; m = m->next, i++) ++ for (i = 0, m = mons; i < nn && m; m = m->next, i++){ + if (i >= n + || unique[i].x_org != m->mx || unique[i].y_org != m->my + || unique[i].width != m->mw || unique[i].height != m->mh) +@@ -1892,6 +1892,10 @@ updategeom(void) + m->mh = m->wh = unique[i].height; + updatebarpos(m); + } ++ if(i == statmonval) ++ statmon = m; ++ } ++ + } else { /* less monitors available nn < n */ + for (i = nn; i < n; i++) { + for (m = mons; m && m->next; m = m->next); +@@ -1905,6 +1909,8 @@ updategeom(void) + } + if (m == selmon) + selmon = mons; ++ if (m == statmon) ++ statmon = mons; + cleanupmon(m); + } + } +@@ -1992,7 +1998,7 @@ updatestatus(void) + { + if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) + strcpy(stext, "dwm-"VERSION); +- drawbar(selmon); ++ drawbar(statmon); + } + + void diff --git a/dwm.suckless.org/patches/staticstatus/index.md b/dwm.suckless.org/patches/staticstatus/index.md @@ -0,0 +1,19 @@ +staticstatus +===== + +Description +----------- +This patch forces your status bar to stay put on a single monitor in a multi-monitor setup, no matter where your focus is. You can set which monitor you want the status bar to stay in with the statmonval value (in config.h), whose values are from 0 to (the number of monitors you have)-1. Monitors are enumerated in the order that they're picked up by dwm. Make sure to define the value in your config.h before compiling. + +Configuration +------------- + + static const int statmonval = 0; + +Download +-------- +* [dwm-staticstatus-6.2.diff](dwm-staticstatus-6.2.diff) + +Author +------ +* Ian Ressa <ianprb@posteo.us>