aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
Diffstat (limited to 'swaybar')
-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) {
if (pointer->cursor_theme) {
wl_cursor_theme_destroy(pointer->cursor_theme);
}
+ const char *cursor_theme = getenv("XCURSOR_THEME");
+ unsigned cursor_size = 24;
+ const char *env_cursor_size = getenv("XCURSOR_SIZE");
+ if (env_cursor_size) {
+ char *end;
+ unsigned size = strtoul(env_cursor_size, &end, 10);
+ if (!*end) {
+ cursor_size = size;
+ }
+ }
int scale = pointer->current ? pointer->current->scale : 1;
- pointer->cursor_theme = wl_cursor_theme_load(NULL, 24 * scale,
- seat->bar->shm);
+ pointer->cursor_theme = wl_cursor_theme_load(
+ cursor_theme, cursor_size * scale, seat->bar->shm);
struct wl_cursor *cursor;
cursor = wl_cursor_theme_get_cursor(pointer->cursor_theme, "left_ptr");
pointer->cursor_image = cursor->images[0];