Barpadding patch with status2d
twoeightdev opened this issue · 6 comments
Hi, i apply your barpadding patch, but i think it has conflict with status2d. the patch doesn't throw any errors but the colors in status2d got broken, it is working before i add the barpadding patch. im using vanilla dwm 6.3. thank you sir
Yes pretty much everyone who tries to include a combination of barpadding, status2d and/or systray run into many forms of issues.
I can only recommend trying to patch the barpadding patch manually, it is a relatively small patch.
The status2d patch moves the drawing of the status to the drawstatusbar
function so the side padding that the barpadding patch adds should be taken into account here.
Have a closer look at this line:
ret = x = m->ww - w;
x
should be where it starts to draw, whereas ret
is the returned value.
The way the returned value is used is to derive the text width, again calculated by calculating against the monitor window area width (m->ww
) in drawbar
.
tw = m->ww - drawstatusbar(m, bh, stext);
It is a lot saner to just return the width of the status in drawstatusbar rather than trying to do calculations like this.
In drawstatusbar
perhaps you should have this instead:
ret = w;
x = m->ww - w - 2 * sp;
and in drawbar
:
tw = drawstatusbar(m, bh, stext);
i did try to add like this but it status2d is still broken.
@@ -709,7 +711,7 @@ drawbar(Monitor *m)
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
- tw = m->ww - drawstatusbar(m, bh, stext);
+ tw = drawstatusbar(m, bh, stext);
- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
+ drw_text(drw, m->ww - tw - 2 * sp, 0, tw, bh, 0, stext, 0);
then in drawstatusbar just like you said
drawstatusbar(Monitor *m, int bh, char* stext) {
w += horizpadbar;
- ret = x = m->ww - w;
+ ret = w;
+ x = m->ww - w - 2 * sp;
btw im using this dwm-barpadding-6.3.diff of yours, i just add those what you've said.
But why are you adding
drw_text(drw, m->ww - tw - 2 * sp, 0, tw, bh, 0, stext, 0);
I mean you shouldn't have both drawstatusbar and drw_text.
I mean you shouldn't have both drawstatusbar and drw_text.
sorry sir i dont have enough knowledge of C. i'll try it again sir and report back. thank you
it is working now sir. thank you 😊