icons: partially implement home.pointerCursor to fix XCURSOR_* issues
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
ccf30d8414
commit
0b72dd7dee
3 changed files with 69 additions and 14 deletions
|
@ -19,6 +19,7 @@ with lib; {
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
fonts.enable = true;
|
fonts.enable = true;
|
||||||
gtk.enable = true;
|
gtk.enable = true;
|
||||||
|
icons.enable = true;
|
||||||
qt.enable = true;
|
qt.enable = true;
|
||||||
#// stylix.enable = true;
|
#// stylix.enable = true;
|
||||||
xdg.enable = true;
|
xdg.enable = true;
|
||||||
|
|
|
@ -14,28 +14,18 @@ in {
|
||||||
css = readFile ./style.css;
|
css = readFile ./style.css;
|
||||||
in {
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
gtk3.extraCss = css;
|
|
||||||
|
|
||||||
gtk4 = {
|
|
||||||
extraConfig.gtk-hint-font-metrics = 1; # Fix blurry fonts
|
|
||||||
extraCss = css;
|
|
||||||
};
|
|
||||||
|
|
||||||
font = with config.custom.settings.fonts; {
|
font = with config.custom.settings.fonts; {
|
||||||
name = sans-serif;
|
name = sans-serif;
|
||||||
size = 12;
|
size = 12;
|
||||||
};
|
};
|
||||||
|
|
||||||
iconTheme = {
|
cursorTheme = with config.custom.settings.icons.cursor; {
|
||||||
name = "Papirus-Dark";
|
inherit name package size;
|
||||||
package = pkgs.papirus-icon-theme;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# BUG: home.pointerCursor breaks XCURSOR_PATH for some child windows, so avoid that workaround
|
iconTheme = with config.custom.settings.icons.icon; {
|
||||||
cursorTheme = {
|
inherit name package;
|
||||||
size = 24;
|
|
||||||
name = "GoogleDot-Black";
|
|
||||||
package = pkgs.google-cursor;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
theme = {
|
theme = {
|
||||||
|
@ -45,6 +35,15 @@ in {
|
||||||
# https://github.com/nix-community/home-manager/issues/5133
|
# https://github.com/nix-community/home-manager/issues/5133
|
||||||
#// package = pkgs.adw-gtk3;
|
#// package = pkgs.adw-gtk3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gtk3 = {
|
||||||
|
extraCss = css;
|
||||||
|
};
|
||||||
|
|
||||||
|
gtk4 = {
|
||||||
|
extraConfig.gtk-hint-font-metrics = 1; # Fix blurry fonts
|
||||||
|
extraCss = css;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
55
options/custom/settings/icons.nix
Normal file
55
options/custom/settings/icons.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.settings.icons;
|
||||||
|
in {
|
||||||
|
options.custom.settings.icons = {
|
||||||
|
enable = mkOption {default = false;};
|
||||||
|
|
||||||
|
cursor = {
|
||||||
|
# https://github.com/ful1e5/Google_Cursor
|
||||||
|
name = mkOption {default = "GoogleDot-Black";};
|
||||||
|
package = mkOption {default = pkgs.google-cursor;};
|
||||||
|
size = mkOption {default = 24;};
|
||||||
|
};
|
||||||
|
|
||||||
|
icon = {
|
||||||
|
# https://github.com/PapirusDevelopmentTeam/papirus-icon-theme
|
||||||
|
name = mkOption {default = "Papirus-Dark";};
|
||||||
|
package = mkOption {default = pkgs.papirus-icon-theme;};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [cfg.cursor.package cfg.icon.package];
|
||||||
|
|
||||||
|
# BUG: home.pointerCursor breaks XCURSOR_PATH for some child windows, so avoid that workaround
|
||||||
|
# HACK: Copy home-manager index.theme without setting XCURSOR_* environment variables
|
||||||
|
home-manager.sharedModules = let
|
||||||
|
# https://github.com/nix-community/home-manager/blob/59a4c43e9ba6db24698c112720a58a334117de83/modules/config/home-cursor.nix#L66C3-L77C8
|
||||||
|
defaultIndexThemePackage = pkgs.writeTextFile {
|
||||||
|
name = "index.theme";
|
||||||
|
destination = "/share/icons/default/index.theme";
|
||||||
|
|
||||||
|
text = ''
|
||||||
|
[Icon Theme]
|
||||||
|
Name=Default
|
||||||
|
Comment=Default Cursor Theme
|
||||||
|
Inherits=${cfg.cursor.name}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in [
|
||||||
|
{
|
||||||
|
# https://github.com/nix-community/home-manager/blob/59a4c43e9ba6db24698c112720a58a334117de83/modules/config/home-cursor.nix#L161
|
||||||
|
home.file.".icons/default/index.theme".source = "${defaultIndexThemePackage}/share/icons/default/index.theme";
|
||||||
|
home.file.".icons/${cfg.cursor.name}".source = "${cfg.cursor.package}/share/icons/${cfg.cursor.name}";
|
||||||
|
xdg.dataFile."icons/default/index.theme".source = "${defaultIndexThemePackage}/share/icons/default/index.theme";
|
||||||
|
xdg.dataFile."icons/${cfg.cursor.name}".source = "${cfg.cursor.package}/share/icons/${cfg.cursor.name}";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue