Closed league closed 6 years ago
This is super nice! Thanks for investigating :-)
Maybe a way forward would be to add an option xsession.cursor
having the type nullOr cursorType
where cursorType
is similar to the fontType
and themeType
type in the gtk module. Something like
cursorType = types.submodule {
options = {
package = mkOption {
type = types.package;
example = literalExample "pkgs.vanilla-dmz";
description = "Package providing the cursor.";
};
name = mkOption {
type = types.str;
example = "Vanilla-DMZ";
description = "The cursor name within the package.";
};
size = mkOption {
type = types.int;
example = 64;
description = "The cursor size.";
};
};
};
So you're example configuration would be
xsession.cursor = {
name = "Vanilla-DMZ";
package = pkgs.vanilla-dmz;
size = 64;
};
Now, I guess the tricky part is whether the code setting the xresources
, gtk2
, gtk3
, etc. options should be placed in the different modules or gathered together in a new xcursor.nix
module. I'm kind of inclined to having it all gathered together. Any preference?
But then maybe the font and icon theme configurations should be gathered in an xfont.nix
and xicons.nix
module as well? But let's worry about that in the future.
Thanks, that sounds about right. Could be gathered together, as long as merging settings across multiple places works. (Should be okay for records like in xresources
and gtk3
, not certain about gtk2
because it's a string.)
Anyway I'm entering the part of my week where there's no room to fiddle with such things. But I'll give it a shot after a few days.
The gtk2 textual config should merge without any issues. The resulting order is a bit unspecified but I think it shouldn't matter in this case.
In master now 👍
Oh man, it took me way too long to figure out how to configure the X cursor when using NixOS and Xmonad. (I assume this is easier with Gnome/KDE). But it's life-changing to have properly magnified cursors on my HighDPI display. No more squinting and thrashing the mouse to find that invisible 1-pixel i-beam!
So I thought home-manager might be the place to capture this hard-won knowledge. Since it touches a few different modules here, I'd like advice on how to approach it. Here's the sketch:
I set these using
let
at the top of myhome.nix
:and then plug them in like this:
The
xsetroot
controls how the pointer appears when it's just on the root window, or hovering on taffybar.I assume my let-bound settings could be a cursor-theme module that insinuates itself into all of the above. The cursor themes that I know about within nixpkgs are:
pkgs.vanilla-dmz
includes bothVanilla-DMZ
andVanilla-DMZ-AA
.pkgs.xorg.xcursorthemes
which includeswhiteglass
,redglass
,handhelds
.Thanks.