From 4c6082972e907fd924cfb937b16a2953f4077310 Mon Sep 17 00:00:00 2001 From: notgne2 Date: Sun, 26 Sep 2021 18:04:44 -0700 Subject: [PATCH] use theme hash for element theme name --- home-manager/modules/colors.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/home-manager/modules/colors.nix b/home-manager/modules/colors.nix index b8fd437..9ae0f60 100644 --- a/home-manager/modules/colors.nix +++ b/home-manager/modules/colors.nix @@ -127,6 +127,12 @@ in config = let + colorsJson = builtins.toFile "colors.json" (builtins.toJSON cfg.favColors.base16); + themeHashOut = pkgs.runCommandNoCC "theme-hash" {} '' + cat ${colorsJson} | ${pkgs.coreutils}/bin/sha256sum | ${pkgs.coreutils}/bin/head -c 8 > $out + ''; + themeHash = builtins.readFile themeHashOut; + i3config = { config = { colors = { @@ -171,7 +177,7 @@ in }; elementTheme = { - name = "Nix colors 11"; + name = "colors-${themeHash}"; is_dark = true; colors = { "accent-color" = "#${cfg.favColors.base16.base02}"; @@ -197,7 +203,6 @@ in settingDefaults.custom_themes = [ elementTheme ]; settingDefaults.theme = "custom-${elementTheme.name}"; - default_theme = "custom-${elementTheme.name}"; showLabsSettings = true; }; @@ -211,7 +216,6 @@ in # Element xdg.configFile."Riot/config.json".text = builtins.toJSON elementConfig; xdg.configFile."Element/config.json".text = builtins.toJSON elementConfig; - xdg.configFile."element_theme.json".text = builtins.toJSON elementTheme; # Mako programs.mako = {