aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Ivanov <nikita.vyach.ivanov@gmail.com>2023-07-21 16:49:44 +0200
committerNikita Ivanov <nikita.vyach.ivanov@gmail.com>2023-07-23 04:19:04 +0200
commitf2e4a19158a41c8b92a0ed28b4e612b391550d91 (patch)
tree0c330f279427d191edf0255d11753b642c30b5d2
parent6cd6409ba2a484170bb6fb1c1282635dd6078e28 (diff)
downloaddwlb-f2e4a19158a41c8b92a0ed28b4e612b391550d91.tar.gz
Set cursor theme and size from XCURSOR
-rw-r--r--dwlb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dwlb.c b/dwlb.c
index 7e843e9..f512caa 100644
--- a/dwlb.c
+++ b/dwlb.c
@@ -591,7 +591,11 @@ pointer_enter(void *data, struct wl_pointer *pointer,
}
if (!cursor_image) {
- struct wl_cursor_theme *cursor_theme = wl_cursor_theme_load(NULL, 24 * buffer_scale, shm);
+ const char *size_str = getenv("XCURSOR_SIZE");
+ int size = size_str ? atoi(size_str) : 0;
+ if (size == 0)
+ size = 24;
+ struct wl_cursor_theme *cursor_theme = wl_cursor_theme_load(getenv("XCURSOR_THEME"), size * buffer_scale, shm);
cursor_image = wl_cursor_theme_get_cursor(cursor_theme, "left_ptr")->images[0];
cursor_surface = wl_compositor_create_surface(compositor);
wl_surface_set_buffer_scale(cursor_surface, buffer_scale);