commit b2126bf63c9e0be70ff5d389a5f83863f842daee
parent fbb6c7ff5e70e866e4aed77efd0acce9953c9c3c
Author: wh1tepearl <wh1tepearl@gmail.com>
Date: Tue, 3 Mar 2026 17:21:22 +0000
move coordinates positition and make a COORDINATES_DIVISOR define
Diffstat:
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -56,13 +56,17 @@ static const int sidepad = 5; /* horizontal padding of bar */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#if OCCUPIED_TAGS_DECORATION
-static const char *occupiedtags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+static const char *occupiedtags[] = { "1+", "2+", "3+", "4+", "5+", "6+", "7+", "8+", "9+" };
#endif
#if INFINITE_TAGS
#define MOVE_CANVAS_STEP 120 /* Defines how many pixel will be jumped when using movecanvas function */
#endif
+#if INFINITE_TAGS && IT_SHOW_COORDINATES_IN_BAR
+#define COORDINATES_DIVISOR 10 /* Defines by what number coordinates on the bar will be divided, can be used for making numbers smaller which makes navigation easier */
+#endif
+
#if MOVE_RESIZE_WITH_KEYBOARD
#define MOVE_WITH_KEYBOARD_STEP 50 /* Defines by how many pixels windows will be resized with keyboard */
#define RESIZE_WITH_KEYBOARD_STEP 50 /* Defines by how many pixels windows will be resized with keyboard */
diff --git a/vxwm.c b/vxwm.c
@@ -848,22 +848,27 @@ drawbar(Monitor *m)
#endif
x += w;
}
+
+ w = TEXTW(m->ltsymbol);
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
+
#if INFINITE_TAGS && IT_SHOW_COORDINATES_IN_BAR
+ #if COORDINATES_DIVISOR <= 0
+ #undef COORDINATES_DIVISOR
+ #define COORDINATES_DIVISOR 1
+ #endif
int tagidx = getcurrenttag(m);
char coords[64];
snprintf(coords, sizeof(coords), "[x%d y%d]",
- m->canvas[tagidx].cx / 10,
- m->canvas[tagidx].cy / 10); // Delete 10 if you want to get the most accurate values
+ m->canvas[tagidx].cx / COORDINATES_DIVISOR,
+ m->canvas[tagidx].cy / COORDINATES_DIVISOR);
w = TEXTW(coords);
drw_setscheme(drw, scheme[SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, coords, 0);
x += w;
#endif
- w = TEXTW(m->ltsymbol);
- drw_setscheme(drw, scheme[SchemeNorm]);
- x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
-
if ((w = m->ww - tw - x) > bh) {
if (m->sel) {
#if !ALT_CENTER_OF_BAR_COLOR