Sway: Sway uses default cursor on bar and root window despite setting an alternative

Created on 14 Nov 2018  路  7Comments  路  Source: swaywm/sway

  • sway version: sway version 1.0-beta.1-186-g47cca240 (Nov 13 2018, branch 'master')
  • debug log
  • config file

I have set an alternative cursor on my system in multiple places:

  1. In ~/.icons/default/index.theme
  2. In ~/.config/gtk-3.0/settings.ini
  3. Using the gsettings workaround mentioned in the wiki

GTK+ apps respect the cursor change, but when I hover my mouse over swaybar or simply an empty workspace desktop, the default cursor is still being used.

I have also tried setting the env. var SWAY_CURSOR_THEME to the desired cursor and then starting sway, with no change in behavior.

Most helpful comment

i just want to add here that sway now supports setting the cursor theme and size with the xcursor_theme option in the config and i also had to set it with gsettings for gtk applications like:

set $my_cursor ComixCursors-Green
set $my_cursor_size 48

seat seat0 xcursor_theme $my_cursor $my_cursor_size
exec_always {
    gsettings set org.gnome.desktop.interface cursor-theme $my_cursor
    gsettings set org.gnome.desktop.interface cursor-size $my_cursor_size
}

see: https://github.com/swaywm/sway/blob/f59b665792fb664d00c3acd91e30977a05dc09f3/sway/sway-input.5.scd#L222

All 7 comments

I have set an alternative cursor on my system in multiple places

You've been configuring toolkits, not sway, so this is expected. Also don't expect your configuration to work with all clients.

Setting the cursor theme and size in the sway config is a TODO. We'd need a new seat command.

As for configuring the cursor theme and size for all clients, I've been doing some work but interested parties lack time to review it: https://github.com/swaywm/wlroots/pull/1324

I have also tried setting the env. var SWAY_CURSOR_THEME to the desired cursor and then starting sway, with no change in behavior.

This is a 0.15-specific env variable. It won't work on 1.0. In general we prefer configuration to go in the configuration file. Also the env variable has limitations in a multiseat setup.

Alright, thanks for the input. SWAY_CURSOR_THEME is still listed under the ENVIRONMENT VARIABLES section of the sway 1.0-beta manpage, which is why I thought it might have an effect.

Ah, it should be removed then. We have no plans to support it on 1.0.

Since sway currently does not set any cursor theme, libwayland-cursor should pick up cursors first from ~/.icons/default/cursors and then inherited through ~/.icons/default/index.theme, though. Did you maybe set XCURSOR_PATH?

It was a typo error on my part. The correct cursor is in fact inherited from ~/.icons/default/index.theme Sorry, closing the issue.

i just want to add here that sway now supports setting the cursor theme and size with the xcursor_theme option in the config and i also had to set it with gsettings for gtk applications like:

set $my_cursor ComixCursors-Green
set $my_cursor_size 48

seat seat0 xcursor_theme $my_cursor $my_cursor_size
exec_always {
    gsettings set org.gnome.desktop.interface cursor-theme $my_cursor
    gsettings set org.gnome.desktop.interface cursor-size $my_cursor_size
}

see: https://github.com/swaywm/sway/blob/f59b665792fb664d00c3acd91e30977a05dc09f3/sway/sway-input.5.scd#L222

Documentation on the feature mentioned by @ctype as well as a helper script to pluck the values from GTK settings.ini in the docs here: https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland#setting-values-in-gsettings

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jakubn551 picture jakubn551  路  4Comments

mcmfb picture mcmfb  路  3Comments

Olie440 picture Olie440  路  4Comments

emersion picture emersion  路  4Comments

DpoBoceka picture DpoBoceka  路  4Comments