mirror of
https://github.com/danth/stylix
synced 2024-11-24 21:23:24 +00:00
cava: init with rainbow theme
This commit is contained in:
parent
f8699483e4
commit
9e389c695a
1 changed files with 29 additions and 0 deletions
29
modules/cava/hm.nix
Normal file
29
modules/cava/hm.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
|
||||
mkGradient = colors: lib.listToAttrs (lib.imap0 (i: c: lib.nameValuePair "gradient_color_${toString (i+1)}" "'#${c}'") colors) // {
|
||||
gradient = "1";
|
||||
gradient_count = toString (builtins.length colors);
|
||||
};
|
||||
|
||||
rainbowColors = with config.lib.stylix.colors; [
|
||||
base0E
|
||||
base0D
|
||||
base0C
|
||||
base0B
|
||||
base0A
|
||||
base09
|
||||
base08
|
||||
];
|
||||
|
||||
in {
|
||||
options.stylix.targets.cava = {
|
||||
enable = config.lib.stylix.mkEnableTarget "CAVA" true;
|
||||
rainbow.enable = lib.mkEnableOption "rainbow gradient theming";
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.stylix.enable && config.stylix.targets.cava.enable) {
|
||||
programs.cava.settings.color = lib.mkIf config.stylix.targets.cava.rainbow.enable (mkGradient rainbowColors);
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue