use theme hash for element theme name

This commit is contained in:
notgne2 2021-09-26 18:04:44 -07:00
parent 5ef4c6ec2b
commit 4c6082972e
No known key found for this signature in database
GPG Key ID: BB661E172B42A7F8

View File

@ -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 = {