From 3849e7973ba290eb8bb2326b87b220c8a2634c8d Mon Sep 17 00:00:00 2001 From: Lichthagel Date: Sat, 27 Apr 2024 00:21:27 +0200 Subject: [PATCH] feat(home-manager/fcitx5): apply option --- modules/home-manager/fcitx5.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/home-manager/fcitx5.nix b/modules/home-manager/fcitx5.nix index 9e9fdea2..6bd113a8 100644 --- a/modules/home-manager/fcitx5.nix +++ b/modules/home-manager/fcitx5.nix @@ -9,7 +9,16 @@ let enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5"; in { - options.i18n.inputMethod.fcitx5.catppuccin = ctp.mkCatppuccinOpt "Fcitx5"; + options.i18n.inputMethod.fcitx5.catppuccin = ctp.mkCatppuccinOpt "Fcitx5" // { + apply = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Applies the theme by overwriting `$XDG_CONFIG_HOME/fcitx5/conf/classicui.conf`. + If this is disabled, you must manually set the theme (e.g. by using `fcitx5-configtool`). + ''; + }; + }; config = lib.mkIf enable { assertions = [ @@ -21,8 +30,10 @@ in recursive = true; }; - xdg.configFile."fcitx5/conf/classicui.conf".text = lib.generators.toINIWithGlobalSection { } { - globalSection.Theme = "catppuccin-${cfg.flavour}"; - }; + xdg.configFile."fcitx5/conf/classicui.conf" = lib.mkIf cfg.apply ({ + text = lib.generators.toINIWithGlobalSection { } { + globalSection.Theme = "catppuccin-${cfg.flavour}"; + }; + }); }; }