stylix: set and gate home.pointerCursor.enable#2407
Conversation
mightyiam
left a comment
There was a problem hiding this comment.
Other than the single question, looks good to me. Thank you for splitting it into multiple commits.
| x11.enable = true; | ||
| gtk.enable = true; | ||
| x11.enable = config.stylix.targets.xresources.enable; | ||
| gtk.enable = config.stylix.targets.gtk.enable; |
There was a problem hiding this comment.
There seem to be also dotIcons, hyprCursor and sway. Why shouldn't we enable them?
There was a problem hiding this comment.
-
I enable
swayin the last commit of the series (which is also a refactor, since the original implementation didn’t lean on this feature being handled by Home Manager directly with this facility). -
dotIconsis enabled by default, as mandated by the Freedesktop.org’s Icon Theme Specification:
Note
By default, apps should look in $HOME/.icons (for backwards compatibility), (…)
so I figured that if that were to change in the future (unlikely, but I digress), Home Manager would be the natural layer to take care of it, not Stylix.
- and, last but not least,
hyprcursor: I did not enable it because Stylix currently doesn’t support it. So we would end up feeding Hyprland the config of ahyprcursorthat is not really ahyprcursor, but a good oleXcursor.
I thought it better to wait until:
a) more hyprcursor cursor packages are available and packaged 1, and/or
b) Home Manager is able to support them distinctly. As it is now, there is only one cursor theme package that can be set, via home.pointerCursor.package. The only provision to differenciate the backends is given to size. So, package can be set to either an Xcursor (most of them are, some 1800 and change) or a hyprcursor (just the one, rose-pine-hyprcursor, plus nordzy-cursors-theme2 that supports both formats) so, if we enable both the Xcursor and the hyprcursor backends, one camp is going to be fed the incorrect format.
Clearly, this is a shortcoming of Home Manager’s pointerCursorModule, and should be fixed in Home Manager first, to be able to specify a separate package for the hyprcursor backend. And only then can Stylix safely add support to set this hypothetical home.pointerCursor.hyprcursor.package, as well as the then properly scoped home.pointerCursor.hyprcursor.enable. Maybe via a new stylix.hyprcursor.* set of options.
To be clear, with the status quo, properly setting a hyprcursor cursor theme can be done, but that would imply disabling the other (Xcursor-based) backends (x11, gtk, sway), as well as dotIcons. And since only Hyprland is able to consume hyprcursor for now, the rest of the apps that don’t support server-side cursors are going to be running on built-in defaults, which is, as we know, Not Nice™.
Phew!, that was a mouthful… 😅
EDIT: (With Yoda’s voice) There is another2… So the challenge is going to be for users to be able to determine which formats a given cursor theme package supports...
Footnotes
…tion home-manager now warns when home.pointerCursor is relied on implicitly (nix-community/home-manager#9620); stylix sets cursor.{name,size,package} for the framework/lbischof profile but not .enable yet (nix-community/stylix#2407 is pending). Setting it explicitly preserves current behavior and clears the warning surfaced by this flake bump. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… to silence warning:
Relying on 'home.pointerCursor' to enable cursor config generation is deprecated.
Please update your configuration to explicitly set:
home.pointerCursor.enable = true|false;
This happens because legacy enable of home.pointerCursor has been dropped. See:
- nix-community/home-manager@2ad4996
- nix-community/home-manager@1aac889
Instead of setting them unconditionally, honour the 'targets' system.
This also makes consistent use of the size calculation, same as the other namespaces.
f9d7ad6 to
82d3218
Compare
… to silence warning:
Warning
Relying on
home.pointerCursorto enable cursor config generation is deprecated.Please update your configuration to explicitly set:
home.pointerCursor.enable = true|false;This happens because legacy enable of
home.pointerCursorhas been dropped. See:I’ve also gated it as well as individual namespaces (x11, gtk, sway) to honour the
targetssystem.NOT TO BE BACKPORTED: since only applies to Home Manager changes from its
masterbranch.