diff --git a/sway/input/seat.c b/sway/input/seat.c index 5709a7f7a..317862d3b 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -507,11 +507,15 @@ void seat_remove_device(struct sway_seat *seat, void seat_configure_xcursor(struct sway_seat *seat) { // TODO configure theme and size - const char *cursor_theme = NULL; + const char *cursor_theme = getenv("SWAY_CURSOR_THEME"); + int cursor_size = atoi(getenv("SWAY_CURSOR_SIZE")); + if (cursor_size <= 0) { + cursor_size = 24; + } if (!seat->cursor->xcursor_manager) { seat->cursor->xcursor_manager = - wlr_xcursor_manager_create(cursor_theme, 24); + wlr_xcursor_manager_create(cursor_theme, cursor_size); if (sway_assert(seat->cursor->xcursor_manager, "Cannot create XCursor manager for theme %s", cursor_theme)) { diff --git a/sway/server.c b/sway/server.c index 09ebe83ff..39b53850a 100644 --- a/sway/server.c +++ b/sway/server.c @@ -93,7 +93,13 @@ bool server_init(struct sway_server *server) { server->xwayland_ready.notify = handle_xwayland_ready; // TODO: configurable cursor theme and size - server->xwayland.xcursor_manager = wlr_xcursor_manager_create(NULL, 24); + char *cursor_theme = getenv("SWAY_CURSOR_THEME"); + int cursor_size = atoi(getenv("SWAY_CURSOR_SIZE")); + if (cursor_size <= 0) { + cursor_size = 24; + } + + server->xwayland.xcursor_manager = wlr_xcursor_manager_create(cursor_theme, cursor_size); wlr_xcursor_manager_load(server->xwayland.xcursor_manager, 1); struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor( server->xwayland.xcursor_manager, "left_ptr", 1); @@ -103,6 +109,7 @@ bool server_init(struct sway_server *server) { image->width * 4, image->width, image->height, image->hotspot_x, image->hotspot_y); } + #endif server->server_decoration_manager =