]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: support XCURSOR_THEME and XCURSOR_SIZE
authorJohan Malm <jgm323@gmail.com>
Sun, 28 Nov 2021 22:50:37 +0000 (22:50 +0000)
committerJohan Malm <jgm323@gmail.com>
Sun, 28 Nov 2021 22:50:37 +0000 (22:50 +0000)
Use environment variables XCURSOR_THEME and XCURSOR_SIZE to set cursor
theme and size respectively. Default size is 24.

Find icons themes with the command below or similar:

    find /usr/share/icons/ -type d -name "cursors"

docs/environment
src/cursor.c

index 1122f184a036ce0ec8d6763382f57c267d4e527b..db8ac3d4ac64977335d0a63dc64b610ef3488475 100644 (file)
@@ -1,11 +1,17 @@
 # Example environment file
 
 # Set keyboard layout to Swedish
-XKB_DEFAULT_LAYOUT=se
+XKB_DEFAULT_LAYOUT=se
 
 # Set two keyboard layouts and toggle between them using alt+shift
-XKB_DEFAULT_LAYOUT=se,de
-XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
+XKB_DEFAULT_LAYOUT=se,de
+XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle
 
 # Force firefox to use wayland backend
-# MOZ_ENABLE_WAYLAND=1
+MOZ_ENABLE_WAYLAND=1
+
+# Set cursor theme.
+# Find icons themes with the command below or similar:
+#     find /usr/share/icons/ -type d -name "cursors"
+XCURSOR_THEME=breeze_cursors
+
index 690e045425bad66feaa91b230c73b5911dfbd9d2..dd5cd46d96417838ba853b54b5f5ac6cba6b745a 100644 (file)
@@ -636,7 +636,11 @@ cursor_frame(struct wl_listener *listener, void *data)
 void
 cursor_init(struct seat *seat)
 {
-       seat->xcursor_manager = wlr_xcursor_manager_create(NULL, 24);
+       const char *xcursor_theme = getenv("XCURSOR_THEME");
+       const char *xcursor_size = getenv("XCURSOR_SIZE");
+       uint32_t size = xcursor_size ? atoi(xcursor_size) : 24;
+
+       seat->xcursor_manager = wlr_xcursor_manager_create(xcursor_theme, size);
        wlr_xcursor_manager_load(seat->xcursor_manager, 1);
 
        seat->cursor_motion.notify = cursor_motion;