summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorUtkarsh Verma <[email protected]>2021-12-26 18:29:55 +0530
committerUtkarsh Verma <[email protected]>2021-12-26 18:30:37 +0530
commit8f401e1d81862333b453bb1b184caded6ee643f8 (patch)
treecf477127e6ca7a589891b9846845799899485283
parent40d30e5d1bc4c1a57eab850657ad5818477ac153 (diff)
downloaddwm-flexipatch-8f401e1d81862333b453bb1b184caded6ee643f8.tar.gz
dwm-flexipatch-8f401e1d81862333b453bb1b184caded6ee643f8.zip
Add a new patch to integrate vanity gaps with bar padding
-rw-r--r--dwm.c9
-rw-r--r--patch/vanitygaps.c10
-rw-r--r--patches.def.h6
3 files changed, 24 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index 70ef5e7..938ba0e 100644
--- a/dwm.c
+++ b/dwm.c
@@ -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
diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c
index be2ef08..757aa4d 100644
--- a/patch/vanitygaps.c
+++ b/patch/vanitygaps.c
@@ -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);
}
diff --git a/patches.def.h b/patches.def.h
index 022a4a6..037c5ee 100644
--- a/patches.def.h
+++ b/patches.def.h
@@ -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