Use substituteAll for fcitx5 theming

inky
Elnu 1 year ago
parent a548fbba06
commit e42f845f09

@ -1,7 +1,7 @@
{ pkgs, ... }:
let
themeFolder = ".local/share/fcitx5/themes/Theme/";
with import ../theme; let
themeFolder = ".local/share/fcitx5/themes/${theme}/";
in
{
i18n.inputMethod = {
@ -10,9 +10,13 @@ in
};
home.file = {
"${themeFolder}theme.conf".text = import ./theme.nix;
"${themeFolder}theme.conf".source = with colors; pkgs.substituteAll ({
src = ./theme.conf;
background = "${bg1}80";
highlight = bg0;
} // colors);
"${themeFolder}arrow.png".source = ./arrow.png;
"${themeFolder}radio.png".source = ./radio.png;
".config/fcitx5/conf/classicui.conf".text = "Theme=Theme";
".config/fcitx5/conf/classicui.conf".text = "Theme=${theme}";
};
}

@ -1,20 +1,12 @@
# Modified from https://github.com/tonyfettes/fcitx5-nord
let
theme = import ../theme;
in with theme.colors; let
background = "${bg1}80";
highlight = "${bg0}";
in
''
[Metadata]
ScaleWithDPI=True
[InputPanel]
Font=Sans 13
NormalColor=${fg0}
HighlightCandidateColor=${fg1};
HighlightColor=${undefined}
HighlightBackgroundColor=${undefined}
NormalColor=@fg0@
HighlightCandidateColor=@fg1@;
HighlightColor=@undefined@
HighlightBackgroundColor=@undefined@
Spacing=3
[InputPanel/TextMargin]
@ -24,7 +16,7 @@ Top=6
Bottom=6
[InputPanel/Background]
Color=${background}
Color=@background@
[InputPanel/Background/Margin]
Left=2
@ -33,7 +25,7 @@ Top=2
Bottom=2
[InputPanel/Highlight]
Color=${highlight}
Color=@highlight@
[InputPanel/Highlight/Margin]
Left=10
@ -43,11 +35,11 @@ Bottom=7
[Menu]
Font=Sans 10
NormalColor=${fg0}
NormalColor=@fg0@
Spacing=3
[Menu/Background]
Color=${background}
Color=@background@
[Menu/Background/Margin]
Left=2
@ -62,7 +54,7 @@ Top=2
Bottom=2
[Menu/Highlight]
Color=${highlight}
Color=@highlight@
[Menu/Highlight/Margin]
Left=10
@ -71,7 +63,7 @@ Top=5
Bottom=5
[Menu/Separator]
Color=${highlight}
Color=@highlight@
[Menu/CheckBox]
Image=radio.png
@ -84,4 +76,3 @@ Left=5
Right=5
Top=5
Bottom=5
''
Loading…
Cancel
Save