From 8bdb55cc1c13f572b6e4307a3c0d64f1ae286a4f Mon Sep 17 00:00:00 2001 From: oli <35699052+pinkcreeper100@users.noreply.github.com> Date: Wed, 24 Jul 2024 02:27:00 +0100 Subject: [PATCH] feat(home-manager/mpv): add support for uosc (#291) --- modules/home-manager/mpv.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/mpv.nix b/modules/home-manager/mpv.nix index e56bf29..7d845ce 100644 --- a/modules/home-manager/mpv.nix +++ b/modules/home-manager/mpv.nix @@ -1,18 +1,23 @@ { config, lib, ... }: let inherit (config.catppuccin) sources; + inherit (lib) ctp mkIf; cfg = config.programs.mpv.catppuccin; enable = cfg.enable && config.programs.mpv.enable; themeDir = sources.mpv + "/themes/${cfg.flavor}/${cfg.accent}"; + uoscDir = sources.mpv + "/uosc/themes/${cfg.flavor}/${cfg.accent}"; in { - options.programs.mpv.catppuccin = lib.ctp.mkCatppuccinOpt { name = "mpv"; } // { - accent = lib.ctp.mkAccentOpt "mpv"; + options.programs.mpv.catppuccin = ctp.mkCatppuccinOpt { name = "mpv"; } // { + accent = ctp.mkAccentOpt "mpv"; }; # Note that the theme is defined across multiple files - config.programs.mpv = lib.mkIf enable { - config = lib.ctp.fromINI (themeDir + "/mpv.conf"); - scriptOpts.stats = lib.ctp.fromINI (themeDir + "/script-opts/stats.conf"); + 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"); + }; }; }