From 93ff8ec760c4619658d42d8576c4b84f553f81e7 Mon Sep 17 00:00:00 2001 From: egorguslyan Date: Sat, 4 Dec 2021 16:34:17 +0300 Subject: [PATCH] allow specify cursor theme and size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Leonardo Hernández Hernández --- config.def.h | 2 ++ dwl.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index fbd59dc..568d946 100644 --- a/config.def.h +++ b/config.def.h @@ -14,6 +14,8 @@ static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0}; +static const char *cursortheme = NULL; /* theme from /usr/share/cursors/xorg-x11 or ${XCURSOR_PATH} */ +static const char cursorsize[] = "24"; /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; diff --git a/dwl.c b/dwl.c index 7e8f523..80e4d11 100644 --- a/dwl.c +++ b/dwl.c @@ -2692,7 +2692,12 @@ setup(void) * Xcursor themes to source cursor images from and makes sure that cursor * images are available at all scale factors on the screen (necessary for * HiDPI support). Scaled cursors will be loaded with each output. */ - cursor_mgr = wlr_xcursor_manager_create(NULL, 24); + cursor_mgr = wlr_xcursor_manager_create(cursortheme, atoi(cursorsize)); + setenv("XCURSOR_SIZE", cursorsize, 1); + if (cursortheme) + setenv("XCURSOR_THEME", cursortheme, 1); + else + unsetenv("XCURSOR_THEME"); /* * wlr_cursor *only* displays an image on screen. It does not move around