diff --git a/_sources/generated.json b/_sources/generated.json index 6eabaf83..255e89d8 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -679,6 +679,26 @@ }, "version": "2e74ddba0c582b2ca2d9d06f67f5a902c3a093fb" }, + "waybar": { + "cargoLocks": null, + "date": "2024-03-31", + "extract": null, + "name": "waybar", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "catppuccin", + "repo": "waybar", + "rev": "0830796af6aa64ce8bc7453d42876a628777ac68", + "sha256": "sha256-9lY+v1CTbpw2lREG/h65mLLw5KuT8OJdEPOb+NNC6Fo=", + "type": "github" + }, + "version": "0830796af6aa64ce8bc7453d42876a628777ac68" + }, "yazi": { "cargoLocks": null, "date": "2024-02-21", @@ -719,4 +739,4 @@ }, "version": "0adc53028d81bf047461bc61c43a484d11b15220" } -} \ No newline at end of file +} diff --git a/_sources/generated.nix b/_sources/generated.nix index 18fcd1bc..3a0431eb 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -409,6 +409,18 @@ }; date = "2023-09-30"; }; + waybar = { + pname = "waybar"; + version = "0830796af6aa64ce8bc7453d42876a628777ac68"; + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "waybar"; + rev = "0830796af6aa64ce8bc7453d42876a628777ac68"; + fetchSubmodules = false; + sha256 = "sha256-9lY+v1CTbpw2lREG/h65mLLw5KuT8OJdEPOb+NNC6Fo="; + }; + date = "2024-03-31"; + }; yazi = { pname = "yazi"; version = "0846aed69b2a62d29c98e100af0cf55ca729723d"; diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix new file mode 100644 index 00000000..684e3bb4 --- /dev/null +++ b/modules/home-manager/waybar.nix @@ -0,0 +1,41 @@ +{ config +, options +, lib +, sources +, ... +}: +let + cfg = config.programs.waybar.catppuccin; + enable = cfg.enable && config.programs.waybar.enable; + styleFile = "${sources.waybar}/themes/${cfg.flavour}.css"; +in +{ + options.programs.waybar.catppuccin = (lib.ctp.mkCatppuccinOpt "waybar") // { + mode = lib.mkOption { + type = lib.types.enum [ + "prependImport" + "createLink" + ]; + default = "prependImport"; + description = '' + Defines how to include the catppuccin theme css file: + + - `prependImport`: Prepends the import statement, if `programs.waybar.style` is a string (with default override priority). + - `createLink`: Creates a symbolic link `~/.config/waybar/catppuccin.css`, which needs to be included in the waybar stylesheet. + ''; + }; + }; + + config = lib.mkIf enable ( + lib.mkMerge [ + (lib.mkIf (cfg.mode == "prependImport") { + programs.waybar.style = lib.mkBefore '' + @import "${styleFile}"; + ''; + }) + (lib.mkIf (cfg.mode == "createLink") { + xdg.configFile."waybar/catppuccin.css".source = styleFile; + }) + ] + ); +} diff --git a/nvfetcher.toml b/nvfetcher.toml index 9ca792a5..13c31d21 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -134,6 +134,10 @@ fetch.github = "catppuccin/tmux" src.git = "https://github.com/catppuccin/tofi.git" fetch.github = "catppuccin/tofi" +[waybar] +src.git = "https://github.com/catppuccin/waybar.git" +fetch.github = "catppuccin/waybar" + [yazi] src.git = "https://github.com/catppuccin/yazi.git" fetch.github = "catppuccin/yazi" diff --git a/test.nix b/test.nix index 12bb5ca4..5b59716c 100644 --- a/test.nix +++ b/test.nix @@ -87,6 +87,7 @@ in swaylock = enable; tmux = enable; tofi = enable; + waybar = enable; yazi = enable; zathura = enable; zellij = enable;