feat(fcitx5): Catppuccin -> Rose Pine

This commit is contained in:
punkfairie 2024-10-19 19:48:53 -07:00
parent db4860d283
commit 9479745881
Signed by: punkfairie
GPG key ID: 01823C057725C266
2 changed files with 31 additions and 23 deletions

View file

@ -88,13 +88,13 @@
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "catppuccin",
"owner": "rose-pine",
"repo": "fcitx5"
},
"branch": "main",
"revision": "3471b918d4b5aab2d3c3dd9f2c3b9c18fb470e8e",
"url": "https://github.com/catppuccin/fcitx5/archive/3471b918d4b5aab2d3c3dd9f2c3b9c18fb470e8e.tar.gz",
"hash": "0rsyrwc74pif9x0f5l3d9bb0s4van0py8qis6qr3zsqq65aqb2nl"
"revision": "148de09929c2e2f948376bb23bc25d72006403bc",
"url": "https://github.com/rose-pine/fcitx5/archive/148de09929c2e2f948376bb23bc25d72006403bc.tar.gz",
"hash": "0gywb8ykb2j3zyr20w1mc3f5xfw2aw4v9b821d55w36ja753k52a"
},
"fish": {
"type": "Git",

View file

@ -1,30 +1,38 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.i18n.inputMethod.fcitx5.catppuccin;
enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5";
in
{
options.i18n.inputMethod.fcitx5.catppuccin = lib.ctp.mkCatppuccinOpt { name = "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,
...
}: let
inherit (config.rose-pine) sources;
cfg = config.i18n.inputMethod.fcitx5.rose-pine;
enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5";
themeName =
if (cfg.flavor == "main")
then "rose-pine"
else "rose-pine-${cfg.flavor}";
in {
options.i18n.inputMethod.fcitx5.rose-pine =
lib.rp.mkRosePineOpt {name = "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 {
xdg.dataFile."fcitx5/themes/catppuccin-${cfg.flavor}" = {
source = "${sources.fcitx5}/src/catppuccin-${cfg.flavor}";
xdg.dataFile."fcitx5/themes/${themeName}" = {
source = "${sources.fcitx5}/${themeName}";
recursive = true;
};
xdg.configFile."fcitx5/conf/classicui.conf" = lib.mkIf cfg.apply {
text = lib.generators.toINIWithGlobalSection { } {
globalSection.Theme = "catppuccin-${cfg.flavor}";
text = lib.generators.toINIWithGlobalSection {} {
globalSection.Theme = themeName;
};
};
};