Skip to content

Commit

Permalink
home-cursor: add doticons option
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Feb 19, 2025
1 parent 3174c0c commit 79c7a05
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions modules/config/home-cursor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ let
'';
};

doticons = {
enable = mkEnableOption ''
doticons config generation for {option}`home.pointerCursor`
'' // {
default = true;
};
};

hyprcursor = {
enable = mkEnableOption "hyprcursor config generation";

Expand Down Expand Up @@ -177,20 +185,22 @@ in {
XCURSOR_THEME = mkDefault cfg.name;
};

# Add symlink of cursor icon directory to $HOME/.icons, needed for
# backwards compatibility with some applications. See:
# https://specifications.freedesktop.org/icon-theme-spec/latest/ar01s03.html
home.file.".icons/default/index.theme".source =
"${defaultIndexThemePackage}/share/icons/default/index.theme";
home.file.".icons/${cfg.name}".source =
"${cfg.package}/share/icons/${cfg.name}";

# Add cursor icon link to $XDG_DATA_HOME/icons as well for redundancy.
xdg.dataFile."icons/default/index.theme".source =
"${defaultIndexThemePackage}/share/icons/default/index.theme";
xdg.dataFile."icons/${cfg.name}".source =
"${cfg.package}/share/icons/${cfg.name}";
}
# Add cursor icon link to $XDG_DATA_HOME/icons as well for redundancy.
xdg.dataFile."icons/default/index.theme".source =
"${defaultIndexThemePackage}/share/icons/default/index.theme";
xdg.dataFile."icons/${cfg.name}".source =
"${cfg.package}/share/icons/${cfg.name}";
}

(mkIf cfg.doticons.enable {
# Add symlink of cursor icon directory to $HOME/.icons, needed for
# backwards compatibility with some applications. See:
# https://specifications.freedesktop.org/icon-theme-spec/latest/ar01s03.html
home.file.".icons/default/index.theme".source =
"${defaultIndexThemePackage}/share/icons/default/index.theme";
home.file.".icons/${cfg.name}".source =
"${cfg.package}/share/icons/${cfg.name}";
})

(mkIf cfg.x11.enable {
xsession.profileExtra = ''
Expand Down

0 comments on commit 79c7a05

Please sign in to comment.