2024-05-21 14:53:46 -07:00
|
|
|
{ config, lib, ... }:
|
2024-04-18 14:55:19 -07:00
|
|
|
let
|
2024-05-13 13:33:16 -07:00
|
|
|
inherit (config.catppuccin) sources;
|
2024-07-23 18:27:00 -07:00
|
|
|
inherit (lib) ctp mkIf;
|
2024-04-18 14:55:19 -07:00
|
|
|
cfg = config.programs.mpv.catppuccin;
|
|
|
|
enable = cfg.enable && config.programs.mpv.enable;
|
2024-05-21 17:23:55 -07:00
|
|
|
themeDir = sources.mpv + "/themes/${cfg.flavor}/${cfg.accent}";
|
2024-07-23 18:27:00 -07:00
|
|
|
uoscDir = sources.mpv + "/uosc/themes/${cfg.flavor}/${cfg.accent}";
|
2024-04-18 14:55:19 -07:00
|
|
|
in
|
|
|
|
{
|
2024-07-23 18:27:00 -07:00
|
|
|
options.programs.mpv.catppuccin = ctp.mkCatppuccinOpt { name = "mpv"; } // {
|
|
|
|
accent = ctp.mkAccentOpt "mpv";
|
2024-05-21 14:53:46 -07:00
|
|
|
};
|
2024-04-18 14:55:19 -07:00
|
|
|
|
|
|
|
# Note that the theme is defined across multiple files
|
2024-07-23 18:27:00 -07:00
|
|
|
config.programs.mpv = mkIf enable {
|
|
|
|
config = ctp.fromINI (themeDir + "/mpv.conf");
|
|
|
|
scriptOpts = {
|
|
|
|
stats = ctp.fromINI (themeDir + "/script-opts/stats.conf");
|
|
|
|
uosc = ctp.fromINI (uoscDir + "/script-opts/uosc.conf");
|
|
|
|
};
|
2024-04-18 14:55:19 -07:00
|
|
|
};
|
|
|
|
}
|