commit 331482cd3149c39c5fde2dbc62845423dc740061
parent fa740552b8684f27481ced58a235776a1807ce56
Author: wh1tepearl <wh1tepearl@gmail.com>
Date: Sat, 13 Jun 2026 22:21:11 +0100
2.3 release, added zoom integration, make external bars always on top and some other fixes
Diffstat:
10 files changed, 88 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
@@ -34,10 +34,12 @@ dist: clean
rm -rf vxwm-${VERSION}
install: all
- install -D -m 755 vxwm ${DESTDIR}${PREFIX}/bin/vxwm
- install -D -m 755 rvx ${DESTDIR}${PREFIX}/bin/rvx
- install -D -m 644 vxwm.1 ${DESTDIR}${MANPREFIX}/man1/vxwm.1
- sed -i 's/VERSION/${VERSION}/g' ${DESTDIR}${MANPREFIX}/man1/vxwm.1
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f vxwm ${DESTDIR}${PREFIX}/bin/vxwm
+ chmod 755 ${DESTDIR}${PREFIX}/bin/vxwm
+ mkdir -p ${DESTDIR}${MANPREFIX}/man1
+ sed "s/VERSION/${VERSION}/g" < vxwm.1 > ${DESTDIR}${MANPREFIX}/man1/vxwm.1
+ chmod 644 ${DESTDIR}${MANPREFIX}/man1/vxwm.1
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/vxwm\
diff --git a/config.def.h b/config.def.h
@@ -3,7 +3,7 @@
/* See LICENSE file for copyright and license details. */
/* appearance */
-static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int borderpx = 3; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
@@ -35,10 +35,10 @@ static const int user_bh = 0;
#endif
#if BAR_PADDING
-static const int top_vertpad = 3; /* top vertical padding of bar */
-static const int bottom_vertpad = 3; /* bottom vertical padding of bar */
-static const int left_sidepad = 3; /* left horizontal padding of bar */
-static const int right_sidepad = 3; /* right horizontal padding of bar */
+static const int top_vertpad = 0; /* top vertical padding of bar */
+static const int bottom_vertpad = 0; /* bottom vertical padding of bar */
+static const int left_sidepad = 0; /* left horizontal padding of bar */
+static const int right_sidepad = 0; /* right horizontal padding of bar */
#endif
/* tagging */
@@ -99,6 +99,9 @@ static const Layout layouts[] = {
#define MODKEY Mod4Mask
#define ALTERNATE_MODKEY Mod1Mask
+#define SCROLL_UP Button4
+#define SCROLL_DOWN Button5
+
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
@@ -114,6 +117,12 @@ static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", normbgco
static const char *termcmd[] = { "st", NULL };
+#if ZOOM
+static const char *zoomin[] = { "vcompmgr", "-Z", "+0.15", NULL }; // zoom in
+static const char *zoomout[] = { "vcompmgr", "-Z", "-0.15", NULL }; // zoom out
+static const char *zoomreset[] = { "vcompmgr", "-Z", "1", NULL }; // set zoom to 1
+#endif
+
static const Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
@@ -188,6 +197,11 @@ static const Key keys[] = {
{ ALTERNATE_MODKEY, XK_Up, focusdir, {.i = 2 } }, // up
{ ALTERNATE_MODKEY, XK_Down, focusdir, {.i = 3 } }, // down
#endif
+#if ZOOM
+ { ALTERNATE_MODKEY, XK_r, spawn, {.v = zoomreset } },
+ { MODKEY, XK_equal, spawn, {.v = zoomin } },
+ { MODKEY, XK_minus, spawn, {.v = zoomout } },
+#endif
};
/* button definitions */
@@ -195,11 +209,19 @@ static const Key keys[] = {
static const Button buttons[] = {
/* click event mask button function argument */
#if INFINITE_TAGS
- { ClkRootWin, MODKEY|ShiftMask, Button1, movecanvasmouse, {.f = 1.5 } },
- { ClkClientWin, MODKEY|ShiftMask, Button1, movecanvasmouse, {.f = 1.5 } },
+ { ClkRootWin, MODKEY|ShiftMask, Button1, movecanvasmouse, {.f = 1.5 } },
+ { ClkClientWin, MODKEY|ShiftMask, Button1, movecanvasmouse, {.f = 1.5 } },
+ { ClkRootWin, 0, Button1, movecanvasmouse, {.f = 1.5 } },
/* .f = 1 is moving multiplier, for example if set to 0.5, canvas will move 2 times slower, if set to 2, canvas will move 2 times faster.
If you want inverted canvas move then set the value to a negative value. */
#endif
+#if ZOOM
+ { ClkRootWin, MODKEY, SCROLL_UP, spawn, {.v = zoomin } },
+ { ClkRootWin, MODKEY, SCROLL_DOWN, spawn, {.v = zoomout } },
+
+ { ClkClientWin, MODKEY, SCROLL_UP, spawn, {.v = zoomin } },
+ { ClkClientWin, MODKEY, SCROLL_DOWN, spawn, {.v = zoomout } },
+#endif
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
{ ClkWinTitle, 0, Button2, swapmaster, {0} },
diff --git a/config.mk b/config.mk
@@ -1,5 +1,5 @@
# vxwm version
-VERSION = 2.2
+VERSION = 2.3
# Customize below to fit your system
diff --git a/modules.def.h b/modules.def.h
@@ -22,7 +22,7 @@ Even though this sounds complex, it is actually pretty lightweight, and is very
*/
#define IT_SHOW_COORDINATES_IN_BAR 1 // Shows your coordinates in the bar, pretty impossible to use infinite tags without this.
-
+#define ZOOM 1 // Zoom integration, requires vcompmgr installed and running.
/* Move/Resize */
diff --git a/modules/infinitetags/infinitetags.c b/modules/infinitetags/infinitetags.c
@@ -76,6 +76,10 @@ movecanvasmouse(const Arg *arg) {
int tagidx = getcurrenttag(selmon);
float multiplier = arg ? arg->f : 1.0f;
float accum_x = 0.0f, accum_y = 0.0f;
+#if ZOOM
+ float zoom_val = zoom_value();
+#endif
+
#if LOCK_MOVE_RESIZE_REFRESH_RATE
Time lasttime = 0;
@@ -107,8 +111,13 @@ movecanvasmouse(const Arg *arg) {
multiplier=0.5, nx=1: accum=0.5, dx=0 --- skip
nx=1: accum=1.0, dx=1 --- move
*/
+#if !ZOOM
accum_x += nx * multiplier;
accum_y += ny * multiplier;
+#else
+ accum_x += nx * multiplier / zoom_val;
+ accum_y += ny * multiplier / zoom_val;
+#endif
int dx = (int)accum_x;
int dy = (int)accum_y;
diff --git a/modules/vxwm_includes.c b/modules/vxwm_includes.c
@@ -55,3 +55,7 @@
#if EXTERNAL_BARS
#include "externalbars/externalbars.c"
#endif
+
+#if ZOOM
+#include "zoom/zoom.c"
+#endif
diff --git a/modules/vxwm_includes.h b/modules/vxwm_includes.h
@@ -51,3 +51,7 @@
#if EXTERNAL_BARS
#include "externalbars/externalbars.h"
#endif
+
+#if ZOOM
+#include "zoom/zoom.h"
+#endif
diff --git a/modules/zoom/zoom.c b/modules/zoom/zoom.c
@@ -0,0 +1,16 @@
+static float zoom_value(void)
+{
+ const char *display = getenv("DISPLAY");
+ if (!display) return 1.0f;
+
+ char path[64];
+ snprintf(path, sizeof(path), "/tmp/vcompmgr_%s.sock.zoom", display);
+
+ float val = 1.0f;
+ FILE *fp = fopen(path, "r");
+ if (!fp) return 1.0f;
+ if (fscanf(fp, "%f", &val) != 1)
+ val = 1.0f;
+ fclose(fp);
+ return val;
+}
diff --git a/modules/zoom/zoom.h b/modules/zoom/zoom.h
@@ -0,0 +1 @@
+static inline float zoom_value(void);
diff --git a/vxwm.c b/vxwm.c
@@ -403,6 +403,7 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact)
*w = MAX(1, *w);
*h = MAX(1, *h);
if (interact) {
+#if !INFINITE_TAGS
if (*x > sw)
*x = sw - WIDTH(c);
if (*y > sh)
@@ -411,6 +412,7 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact)
*x = 0;
if (*y + *h + 2 * c->bw < 0)
*y = 0;
+#endif
} else {
if (*x >= m->wx + m->ww)
*x = m->wx + m->ww - WIDTH(c);
@@ -1414,6 +1416,9 @@ movemouse(const Arg *arg)
#if LOCK_MOVE_RESIZE_REFRESH_RATE
Time lasttime = 0;
#endif
+#if ZOOM
+ float zoom_val = zoom_value();
+#endif
if (!(c = selmon->sel) || c->isfullscreen)
return;
@@ -1439,8 +1444,13 @@ movemouse(const Arg *arg)
continue;
lasttime = ev.xmotion.time;
#endif
+#if !ZOOM
nx = ocx + (ev.xmotion.x - x);
ny = ocy + (ev.xmotion.y - y);
+#else
+ nx = ocx + (ev.xmotion.x - x) / zoom_val;
+ ny = ocy + (ev.xmotion.y - y) / zoom_val;
+#endif
if (abs(selmon->wx - nx) < snap)
nx = selmon->wx;
else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap)
@@ -1705,6 +1715,9 @@ restack(Monitor *m)
Client *c;
XEvent ev;
XWindowChanges wc;
+#if EXTERNAL_BARS
+ ExternalBarStrut *exb;
+#endif
drawbar(m);
if (!m->sel)
@@ -1733,6 +1746,10 @@ restack(Monitor *m)
}
}
XRaiseWindow(dpy, m->barwin);
+#if EXTERNAL_BARS
+ for (exb = ebarstruts; exb; exb = exb->next)
+ XRaiseWindow(dpy, exb->win);
+#endif
/* raise pinned windows because it is annoying when they are below others */
for (c = m->stack; c; c = c->snext)
if (ISVISIBLE(c) && c->is_pinned)