Skip to content

Commit

Permalink
fix(home-manager): correctly set btop's theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Anomalocaridid committed Oct 30, 2023
1 parent 5713b47 commit b343648
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions modules/home-manager/btop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ let
cfg = config.programs.btop.catppuccin;
enable = cfg.enable && config.programs.btop.enable;

themePath = "/themes/catppuccin_${cfg.flavour}.theme";
themeFile = "catppuccin_${cfg.flavour}.theme";
themePath = "/themes/${themeFile}";
theme =
pkgs.fetchFromGitHub
{
Expand All @@ -23,15 +24,14 @@ in
options.programs.btop.catppuccin =
lib.ctp.mkCatppuccinOpt "btop" config;

# xdg is required for this to work
config =
config = mkIf enable
{
xdg.enable = mkIf enable (lib.mkForce true);
xdg = {
# xdg is required for this to work
enable = lib.mkForce true;
configFile."btop${themePath}".source = theme;
};

programs.btop.settings.color_theme =
mkIf enable "${config.xdg.configHome + "/btop/${themePath}"}";
}
// (lib.mkIf enable {
xdg.configFile."btop${themePath}".source = theme;
});
programs.btop.settings.color_theme = themeFile;
};
}

0 comments on commit b343648

Please sign in to comment.