Add a new patch to integrate vanity gaps with bar padding

This commit is contained in:
Utkarsh Verma 2021-12-26 18:29:55 +05:30
parent 40d30e5d1b
commit 8f401e1d81
No known key found for this signature in database
GPG Key ID: 817656CF818EFCCC
3 changed files with 24 additions and 1 deletions

9
dwm.c
View File

@ -4319,7 +4319,14 @@ updatebarpos(Monitor *m)
m->ww = m->mw;
m->wh = m->mh;
Bar *bar;
#if BAR_PADDING_PATCH
#if BAR_GAPS_PADDING_PATCH
int y_pad = 0;
int x_pad = 0;
if (enablegaps) {
y_pad = gappov;
x_pad = gappoh;
}
#elif BAR_PADDING_PATCH
int y_pad = vertpad;
int x_pad = sidepad;
#else

View File

@ -86,6 +86,16 @@ togglegaps(const Arg *arg)
#else
enablegaps = !enablegaps;
#endif // PERTAG_VANITYGAPS_PATCH
#if BAR_GAPS_PADDING_PATCH
updatebarpos(selmon);
Bar *bar = selmon->bar;
XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw + gappoh, bar->bh);
#if BAR_SYSTRAY_PATCH
drawbarwin(systray->bar);
#endif // BAR_SYSTRAY_PATCH
#endif // BAR_GAPS_PADDING_PATCH
arrange(NULL);
}

View File

@ -347,6 +347,12 @@
*/
#define BAR_PADDING_PATCH 0
/* Same as barpadding patch but specifically written for the vanitygaps patch. It adds the same
* outer horizontal and vertical padding as vanity gaps. Moreover, the padding is toggled whenever
* vanitygaps are toggled.
*/
#define BAR_GAPS_PADDING_PATCH 0
/* This patch adds simple markup for status messages using pango markup.
* This depends on the pango library v1.44 or greater.
* You need to uncomment the corresponding lines in config.mk to use the pango libraries