end-4 / dots-hyprland

Modern, feature-rich and accessible desktop configuration.
https://end-4.github.io/dots-hyprland-wiki/en/
GNU General Public License v3.0
3.06k stars 196 forks source link

[Issue] cursor theme setup is broken #603

Closed moetayuko closed 2 weeks ago

moetayuko commented 2 weeks ago

The installer copies Bibata to /usr/local/share/icons, and activates it using hyprctl setcursor Bibata-Modern-Classic 24. However, there are several issues arising from distinct dimensions preventing this from working as expected.

Installation path is invalid

/usr/local/share/icons is neither documented in Arch wiki nor the search path of mainstream GUI frameworks including GTK and Qt. As a result, apps that do not support server-side cursors will fall back to the default Adwaita cursor theme (assuming Bibata-Modern-Classic is already configured manually because hyprctl setcursor won't do this for you).

But why does it work for apps that support server-side cursors despite the path being invalid? Set debug:disable_logs = false in hyprland configuration and run hyprctl setcursor Bibata-Modern-Classic 24, then observe the following error in logs:

[ERR] Hyprcursor failed loading theme "Bibata-Modern-Classic", falling back to X.

indicating that some unknown fallback mechanism caught the path.

Missing hyprcursor variant

hyprcursor is a new vectorized cursor theme format preferred for hyprland.

Missing xcursor setup

As mentioned above, hyprctl setcursor is only effective for apps that support server-side cursors. So it's still necessary to follow traditional xcursor setups for a consistent look.

How to fix

The simplest fix is to drop the cursor setup and let users handle it on their own. Otherwise, the following steps could be considered:

  1. Replace install-bibata with aur package bibata-cursor-git. It contains both xcursor and hyprcursor formats and installs to /usr/share/icons. The error log is gone and becomes
    [hc] getFullPathForThemeName: found /usr/share/icons/Bibata-Modern-Classic
    [hc] Found theme Bibata-Modern-Classic at /usr/share/icons/Bibata-Modern-Classic
    [hc] loadThemeStyle: loading for size 48
    [hc] getShapesC: found 1 images for left_ptr
  2. Add xcursor setup to the installer following Arch wiki.
clsty commented 2 weeks ago

Good suggestion, thanks!

Closing in favor of #620 .