commit d3d3ac5a9b62d65e2647e20cf803d5f1e0ebcc85
parent d1088f16f0dcc653f6987ee92141b7bfb5e19c04
Author: wh1tepearl <wh1tepearl@gmail.com>
Date: Sun, 1 Feb 2026 23:24:27 +0000
Made warp to client highly customizable and updated README.md
Diffstat:
5 files changed, 49 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md
@@ -14,6 +14,11 @@ In order to build vxwm you need the Xlib header files.
## Installation
+Clone this repository and cd into it.
+
+ git clone https://codeberg.org/wh1tepearl/vxwm.git
+ cd vxwm
+
Edit config.mk to match your local setup (vxwm is installed into
the /usr/local namespace by default).
diff --git a/config.def.h b/config.def.h
@@ -7,7 +7,9 @@ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=10" };
static const char dmenufont[] = "monospace:size=10";
+
#if !XRDB //when xrdb is turned off
+
static const char col_gray1[] = "#222222";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
@@ -18,7 +20,9 @@ static const char *colors[][3] = {
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
+
#else //when xrdb is turned on
+
static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfgcolor[] = "#bbbbbb";
@@ -30,6 +34,7 @@ static char *colors[][3] = {
[SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
[SchemeSel] = { selfgcolor, selbgcolor, selbordercolor },
};
+
#endif
#if GAPS
diff --git a/modules.def.h b/modules.def.h
@@ -23,13 +23,23 @@
#define OCCUPIED_TAGS_DECORATION 0 // This provides the ability to use an alternative text for tags which contain at least one window aka occupied tags.
+
+/* Warp to client */
+#define WARP_TO_CLIENT 0 // Includes the warp to client function needed for all options below.
+#define WARP_TO_CENTER_OF_NEW_WINDOW 0 // Warps the cursor to center of the new window.
+#define WARP_TO_CENTER_OF_PREVIOUS_WINDOW 0 // Warps cursor to center of the previous window after closing a window.
+#define WARP_TO_CENTER_OF_ZOOMED_WINDOW 0 // Warps cursor to center of the window that was zoomed using zoom function.
+#define WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_INCNMASTER 0 // Warps the cursor to center of the window that gets affected in use of incnmaster.
+#define WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_ENHANCED_TOGGLE_FLOATING 0 // Warps cursor to center of the window that was affected by using enhancedtogglefloating function.
+#define WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_FOCUSSTACK 0 // Warps cursor to center of the window that was focused by using focusstack function.
+
+
+
/* Misc */
#define FULLSCREEN 0 // Support for toggling fullscreen.
#define MOVE_IN_TILED 0 // Support for moving windows in tiled mode.
#define EWMH_TAGS 0 // Support for EWMH tags, recommended if you want to use external bars with less pain
#define ALWAYS_CENTER_NEW_FLOATING_WINDOWS 0 //so, basically, it does what it says.
-#define WARP_TO_CLIENT 0 // It warps cursor, where? idk, but use it trust me bro.
-#define WARP_TO_CLIENT_AFFECTED_BY_INCNMASTER 0
#define TAG_TO_TAG 0 // If you switch to tag where you already are, it'll switch to previous tag.
diff --git a/modules/etf/etf.c b/modules/etf/etf.c
@@ -24,6 +24,10 @@ enhancedtogglefloating(const Arg *arg)
}
arrange(selmon);
+
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_ENHANCED_TOGGLE_FLOATING
+ warptoclient(selmon->sel); // larptoclient(selmon->sel);
+#endif
}
#else // fuck this shit i almost pulled out all my hair when i wrote this, but atleast it works lol
void
@@ -71,5 +75,9 @@ enhancedtogglefloating(const Arg *arg)
}
arrange(selmon);
+
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_ENHANCED_TOGGLE_FLOATING
+ warptoclient(selmon->sel); // larptoclient(selmon->sel);
+#endif
}
#endif
diff --git a/vxwm.c b/vxwm.c
@@ -924,6 +924,9 @@ focusstack(const Arg *arg)
}
if (c) {
focus(c);
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_FOCUSSTACK
+ warptoclient(c);
+#endif
restack(selmon);
}
}
@@ -1045,22 +1048,8 @@ grabkeys(void)
}
}
-#if !WARP_TO_CLIENT //nah bro larp to client
-void
-incnmaster(const Arg *arg)
-{
- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
- arrange(selmon);
-}
-#elif WARP_TO_CLIENT && !WARP_TO_CLIENT_AFFECTED_BY_INCNMASTER
-void
-incnmaster(const Arg *arg)
-{
- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
- arrange(selmon);
- if (selmon->sel) warptoclient(selmon->sel);
-}
-#else
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_WINDOW_AFFECTED_BY_INCNMASTER
+// LARP_TO_CLIENT
void
incnmaster(const Arg *arg)
{
@@ -1087,6 +1076,16 @@ incnmaster(const Arg *arg)
if (moved)
warptoclient(moved);
}
+
+#else
+
+void
+incnmaster(const Arg *arg)
+{
+ selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
+ arrange(selmon);
+}
+
#endif
#ifdef XINERAMA
@@ -1203,9 +1202,8 @@ manage(Window w, XWindowAttributes *wa)
arrange(c->mon);
XMapWindow(dpy, c->win);
focus(NULL);
-#if WARP_TO_CLIENT
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_NEW_WINDOW
warptoclient(c);
- focus(c);
#endif
}
@@ -2169,7 +2167,7 @@ unmanage(Client *c, int destroyed)
focus(NULL);
updateclientlist();
arrange(m);
-#if WARP_TO_CLIENT
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_PREVIOUS_WINDOW
if (m == selmon && m->sel)
warptoclient(m->sel);
#endif
@@ -2538,7 +2536,7 @@ void
zoom(const Arg *arg)
{
Client *c = selmon->sel;
-#if WARP_TO_CLIENT
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_ZOOMED_WINDOW
Client *target = c;
#endif
@@ -2547,7 +2545,7 @@ zoom(const Arg *arg)
if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next)))
return;
pop(c);
-#if WARP_TO_CLIENT
+#if WARP_TO_CLIENT && WARP_TO_CENTER_OF_ZOOMED_WINDOW
warptoclient(target);
#endif
}