mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
swaybar: add support for cursor themes
- uses environment variables SWAY_CURSOR_THEME and SWAY_CURSOR_SIZE
This commit is contained in:
parent
cd14e1e64d
commit
5280b9510f
1 changed files with 7 additions and 1 deletions
|
|
@ -417,8 +417,14 @@ void bar_setup(struct swaybar *bar,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *cursor_theme = getenv("SWAY_CURSOR_THEME");
|
||||||
|
int cursor_size = atoi(getenv("SWAY_CURSOR_SIZE"));
|
||||||
|
if (cursor_size <= 0) {
|
||||||
|
cursor_size = 24;
|
||||||
|
}
|
||||||
|
|
||||||
pointer->cursor_theme = wl_cursor_theme_load(
|
pointer->cursor_theme = wl_cursor_theme_load(
|
||||||
NULL, 24 * max_scale, bar->shm);
|
cursor_theme, cursor_size * max_scale, bar->shm);
|
||||||
assert(pointer->cursor_theme);
|
assert(pointer->cursor_theme);
|
||||||
struct wl_cursor *cursor;
|
struct wl_cursor *cursor;
|
||||||
cursor = wl_cursor_theme_get_cursor(pointer->cursor_theme, "left_ptr");
|
cursor = wl_cursor_theme_get_cursor(pointer->cursor_theme, "left_ptr");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue