From 3f8366fe353fe7d161821c282a135fb9d6184c35 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Sat, 11 Jan 2025 15:07:46 -0600 Subject: add themed cursor patch and button 3 paste --- PATCHES | 1 + config.def.h | 8 ++++---- config.mk | 2 +- x.c | 17 ++--------------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/PATCHES b/PATCHES index 5cb7b6f..030ad04 100644 --- a/PATCHES +++ b/PATCHES @@ -5,4 +5,5 @@ st-desktopentry-0.8.5.diff st-expected-anysize-0.9.diff st-scrollback-0.9.2.diff st-scrollback-reflow-0.9.2.diff +st-themed_cursor-0.8.1.diff st-undercurl-0.9-20240103.diff diff --git a/config.def.h b/config.def.h index 330f466..86286cd 100644 --- a/config.def.h +++ b/config.def.h @@ -161,11 +161,10 @@ static unsigned int cols = 80; static unsigned int rows = 24; /* - * Default colour and shape of the mouse cursor ++ * Default shape of the mouse cursor */ -static unsigned int mouseshape = XC_xterm; -static unsigned int mousefg = 7; -static unsigned int mousebg = 0; + +static char* mouseshape = "xterm"; /* * Color used to display font attributes when fontconfig selected a font which @@ -191,6 +190,7 @@ static MouseShortcut mshortcuts[] = { { XK_ANY_MOD, Button4, kscrollup, {.i = 3}, 0 }, { XK_ANY_MOD, Button5, kscrolldown, {.i = 3}, 0 }, { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 }, + { XK_ANY_MOD, Button3, selpaste, {.i = 0}, 1 }, { ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} }, { XK_ANY_MOD, Button4, ttysend, {.s = "\031"} }, { ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} }, diff --git a/config.mk b/config.mk index a6c3829..69f0498 100644 --- a/config.mk +++ b/config.mk @@ -17,7 +17,7 @@ PKG_CONFIG = pkg-config INCS = -I$(X11INC) \ `$(PKG_CONFIG) --cflags fontconfig` \ `$(PKG_CONFIG) --cflags freetype2` -LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ +LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXcursor \ `$(PKG_CONFIG) --libs fontconfig` \ `$(PKG_CONFIG) --libs freetype2` diff --git a/x.c b/x.c index e2c7bdc..f6e066b 100644 --- a/x.c +++ b/x.c @@ -14,6 +14,7 @@ #include #include #include +#include char *argv0; #include "arg.h" @@ -1215,23 +1216,9 @@ xinit(int cols, int rows) } /* white cursor, black outline */ - cursor = XCreateFontCursor(xw.dpy, mouseshape); + cursor = XcursorLibraryLoadCursor(xw.dpy, mouseshape); XDefineCursor(xw.dpy, xw.win, cursor); - if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) { - xmousefg.red = 0xffff; - xmousefg.green = 0xffff; - xmousefg.blue = 0xffff; - } - - if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) { - xmousebg.red = 0x0000; - xmousebg.green = 0x0000; - xmousebg.blue = 0x0000; - } - - XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg); - xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False); xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False); xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False); -- cgit v1.2.3