home.pointerCursor: init#2891
home.pointerCursor: init#2891berbiche merged 2 commits intonix-community:masterfrom polykernel:home-pointercursor/init
Conversation
|
@league I would like to know your opinion on whether |
|
I think the merging seems sensible, but with the proviso that I don't use any of these settings currently and wouldn't notice if it subtly breaks something for others. I think I'm approaching the point of view that much of the value for a module like this is in helping people figure out what are the ways to set these sorts of things (especially just for X where you're more "on your own"). If the "happy path" you've blazed here is helpful, then fine. And if someone needs it to work differently, well, it's not really that much harder to set |
|
I guess at a glance I'm not certain why the CI is complaining about: But assuming that's resolved, it's okay with me. |
|
Thank you for your input!
My original idea was to keep |
berbiche
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
|
Hi, could you also address the cursor problem on generic Linux, i.e. also suffix libXcursor by default fallback NixOS has set XCURSOR_PATH to system profile paths to address the problem. See https://github.com/NixOS/nixpkgs/blob/634141959076a8ab69ca2cca0f266852256d79ee/nixos/modules/config/xdg/icons.nix#L31-L40 |
Thanks for the suggestion. I have applied the changes you requested but unfortunately I don't have a non-NixOS box at the moment where I can test the changes. Please let me know if any issues/regressions arise. |
|
Thanks. I have to set both So I guess a more appropriate place to put this logic is ./modules/targets/generic-linux.nix, but that might exceeds the scope of this PR? (edit: If that is the case, I can make a PR if you have less interest in this.) # home.nix
{ pkgs, ... }: {
targets.genericLinux.enable = true;
home.pointerCursor = {
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
};
} |
Yes, it would be more appropriate IMO. |
I think it is better to set In any case, I think another dedicated PR will suit this better. |
| # https://wiki.archlinux.org/title/Cursor_themes#Environment_variable | ||
| home.sessionVariables = { | ||
| XCURSOR_PATH = mkDefault (concatStringsSep ":" [ | ||
| "\${XCURSOR_PATH}" |
The current architecture for cursor configurations is composed of individual options for different backends. For example, X specific settings are managed under `xsession.pointerCursor` and gtk specific settings are managed under `gtk.cursorTheme`. While this architecture is modular, it causes duplication of similar structures for each component. In theory, this provides flexibility because the components are independent of each other which can be arranged in arbitrary ways to achieve the desired result. However in practice, users wish to have one cursor theme applied to their entire system The duplication of options correspond to duplication of settings on the user side and it becomes a burden to keep track of all necessary settings. This commit is an attempt to unify cursor configurations for different window systems and GUI toolkits based on #2481 (comment). `home.pointerCursor` is introduced as the interface for all cursor configurations. It contain all options relevant to cursor themes with eneral options delcared under `home.pointerCursor.*` and backend specific options declared under `home.pointerCursor.<backend>.*`. By default, a backend independent configuration is generated. Backend specific configurations can be toggled via the `home.pointerCursor.<backend>.enable` option for each backend. This was decided over using a list of enums because it allows easy access to the state of the backend. Note generating different cursor configurations for different backends is still possible by defining only `home.pointerCursor` and managing the respective options manually.
- Removed `xession.pointerCursor` as x11 cursor configurations are now handled in `home.pointerCursor.x11`. - Updated `meta.maintainer` field in `home.pointerCursor` and CODEOWNERS.
…2902) This commit appends system-wide icon and pixmap directory and the icon directory in the home-manager profile to the XCURSOR_PATH session variable for the generic linux target. This is necessary because the default prefix for libXcursor resolves to the Nix store which excludes the aforementioned directories from being searched for cursor themes. [1] [1] - #2891 (comment).
berbiche
left a comment
There was a problem hiding this comment.
LGTM!
I'll wait a few days to see if there are other reviews before merging.
…ix-community#2902) This commit appends system-wide icon and pixmap directory and the icon directory in the home-manager profile to the XCURSOR_PATH session variable for the generic linux target. This is necessary because the default prefix for libXcursor resolves to the Nix store which excludes the aforementioned directories from being searched for cursor themes. [1] [1] - nix-community#2891 (comment).
|
I forgot that we need to add a news entry to the 22.05 release notes ( |
* home.pointerCursor: init The current architecture for cursor configurations is composed of individual options for different backends. For example, X specific settings are managed under `xsession.pointerCursor` and gtk specific settings are managed under `gtk.cursorTheme`. While this architecture is modular, it causes duplication of similar structures for each component. In theory, this provides flexibility because the components are independent of each other which can be arranged in arbitrary ways to achieve the desired result. However in practice, users wish to have one cursor theme applied to their entire system The duplication of options correspond to duplication of settings on the user side and it becomes a burden to keep track of all necessary settings. This commit is an attempt to unify cursor configurations for different window systems and GUI toolkits based on nix-community#2481 (comment). `home.pointerCursor` is introduced as the interface for all cursor configurations. It contain all options relevant to cursor themes with eneral options delcared under `home.pointerCursor.*` and backend specific options declared under `home.pointerCursor.<backend>.*`. By default, a backend independent configuration is generated. Backend specific configurations can be toggled via the `home.pointerCursor.<backend>.enable` option for each backend. This was decided over using a list of enums because it allows easy access to the state of the backend. Note generating different cursor configurations for different backends is still possible by defining only `home.pointerCursor` and managing the respective options manually. * xcursor: migrate options to home.pointerCursor - Removed `xession.pointerCursor` as x11 cursor configurations are now handled in `home.pointerCursor.x11`. - Updated `meta.maintainer` field in `home.pointerCursor` and CODEOWNERS.
…ix-community#2902) This commit appends system-wide icon and pixmap directory and the icon directory in the home-manager profile to the XCURSOR_PATH session variable for the generic linux target. This is necessary because the default prefix for libXcursor resolves to the Nix store which excludes the aforementioned directories from being searched for cursor themes. [1] [1] - nix-community#2891 (comment).
* home.pointerCursor: init The current architecture for cursor configurations is composed of individual options for different backends. For example, X specific settings are managed under `xsession.pointerCursor` and gtk specific settings are managed under `gtk.cursorTheme`. While this architecture is modular, it causes duplication of similar structures for each component. In theory, this provides flexibility because the components are independent of each other which can be arranged in arbitrary ways to achieve the desired result. However in practice, users wish to have one cursor theme applied to their entire system The duplication of options correspond to duplication of settings on the user side and it becomes a burden to keep track of all necessary settings. This commit is an attempt to unify cursor configurations for different window systems and GUI toolkits based on nix-community#2481 (comment). `home.pointerCursor` is introduced as the interface for all cursor configurations. It contain all options relevant to cursor themes with eneral options delcared under `home.pointerCursor.*` and backend specific options declared under `home.pointerCursor.<backend>.*`. By default, a backend independent configuration is generated. Backend specific configurations can be toggled via the `home.pointerCursor.<backend>.enable` option for each backend. This was decided over using a list of enums because it allows easy access to the state of the backend. Note generating different cursor configurations for different backends is still possible by defining only `home.pointerCursor` and managing the respective options manually. * xcursor: migrate options to home.pointerCursor - Removed `xession.pointerCursor` as x11 cursor configurations are now handled in `home.pointerCursor.x11`. - Updated `meta.maintainer` field in `home.pointerCursor` and CODEOWNERS.
…ix-community#2902) This commit appends system-wide icon and pixmap directory and the icon directory in the home-manager profile to the XCURSOR_PATH session variable for the generic linux target. This is necessary because the default prefix for libXcursor resolves to the Nix store which excludes the aforementioned directories from being searched for cursor themes. [1] [1] - nix-community#2891 (comment).
* home.pointerCursor: init The current architecture for cursor configurations is composed of individual options for different backends. For example, X specific settings are managed under `xsession.pointerCursor` and gtk specific settings are managed under `gtk.cursorTheme`. While this architecture is modular, it causes duplication of similar structures for each component. In theory, this provides flexibility because the components are independent of each other which can be arranged in arbitrary ways to achieve the desired result. However in practice, users wish to have one cursor theme applied to their entire system The duplication of options correspond to duplication of settings on the user side and it becomes a burden to keep track of all necessary settings. This commit is an attempt to unify cursor configurations for different window systems and GUI toolkits based on nix-community#2481 (comment). `home.pointerCursor` is introduced as the interface for all cursor configurations. It contain all options relevant to cursor themes with eneral options delcared under `home.pointerCursor.*` and backend specific options declared under `home.pointerCursor.<backend>.*`. By default, a backend independent configuration is generated. Backend specific configurations can be toggled via the `home.pointerCursor.<backend>.enable` option for each backend. This was decided over using a list of enums because it allows easy access to the state of the backend. Note generating different cursor configurations for different backends is still possible by defining only `home.pointerCursor` and managing the respective options manually. * xcursor: migrate options to home.pointerCursor - Removed `xession.pointerCursor` as x11 cursor configurations are now handled in `home.pointerCursor.x11`. - Updated `meta.maintainer` field in `home.pointerCursor` and CODEOWNERS.
Description
The current architecture for cursor configurations is composed of individual
options for different backends. For example, X specific settings are managed under
xsession.pointerCursorand gtk specific settings are managed undergtk.cursorTheme.While this architecture is modular, it causes duplication of similar structures for
each component. In theory, this provides flexibility because the components are independent
of each other which can be arranged in arbitrary ways to achieve the desired result.
However in practice, users wish to have one cursor theme applied to their entire system
The duplication of options correspond to duplication of settings on the user side and it
becomes a burden to keep track of all necessary settings.
This commit is an attempt to unify cursor configurations for different window systems and
GUI toolkits based on #2481 (comment).
home.pointerCursoris introduced as the interfacefor all cursor configurations. It contain all options relevant to cursor themes with eneral options delcared under
home.pointerCursor.*and backend specific options declared underhome.pointerCursor.<backend>.*.By default, a backend independent configuration is generated. Backend specific configurations can be toggled
via the
home.pointerCursor.<backend>.enableoption for each backend. This was decided over using alist of enums because it allows easy access to the state of the backend. Note generating different
cursor configurations for different backends is still possible by defining only
home.pointerCursorand managing the respective options manually.
I am not sure whether options such as
gtk.cursorThemeandxsession.pointerCursorshould be merged intohome.pointerCursoror not. Any feedback would be greatly appreciated!Checklist
Change is backwards compatible.
Code formatted with
./format.Code tested through
nix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Added myself as module maintainer. See example.
Added myself and the module files to
.github/CODEOWNERS.