aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar/input.c')
-rw-r--r--swaybar/input.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/swaybar/input.c b/swaybar/input.c
index 92972146..8a83f38f 100644
--- a/swaybar/input.c
+++ b/swaybar/input.c
@@ -67,9 +67,19 @@ void update_cursor(struct swaybar_seat *seat) {
67 if (pointer->cursor_theme) { 67 if (pointer->cursor_theme) {
68 wl_cursor_theme_destroy(pointer->cursor_theme); 68 wl_cursor_theme_destroy(pointer->cursor_theme);
69 } 69 }
70 const char *cursor_theme = getenv("XCURSOR_THEME");
71 unsigned cursor_size = 24;
72 const char *env_cursor_size = getenv("XCURSOR_SIZE");
73 if (env_cursor_size) {
74 char *end;
75 unsigned size = strtoul(env_cursor_size, &end, 10);
76 if (!*end) {
77 cursor_size = size;
78 }
79 }
70 int scale = pointer->current ? pointer->current->scale : 1; 80 int scale = pointer->current ? pointer->current->scale : 1;
71 pointer->cursor_theme = wl_cursor_theme_load(NULL, 24 * scale, 81 pointer->cursor_theme = wl_cursor_theme_load(
72 seat->bar->shm); 82 cursor_theme, cursor_size * scale, seat->bar->shm);
73 struct wl_cursor *cursor; 83 struct wl_cursor *cursor;
74 cursor = wl_cursor_theme_get_cursor(pointer->cursor_theme, "left_ptr"); 84 cursor = wl_cursor_theme_get_cursor(pointer->cursor_theme, "left_ptr");
75 pointer->cursor_image = cursor->images[0]; 85 pointer->cursor_image = cursor->images[0];