Use substituteAll for fcitx5 theming

inky
Elnu 2 years ago
parent a548fbba06
commit e42f845f09

@ -1,7 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let with import ../theme; let
themeFolder = ".local/share/fcitx5/themes/Theme/"; themeFolder = ".local/share/fcitx5/themes/${theme}/";
in in
{ {
i18n.inputMethod = { i18n.inputMethod = {
@ -10,9 +10,13 @@ in
}; };
home.file = { 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}arrow.png".source = ./arrow.png;
"${themeFolder}radio.png".source = ./radio.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] [Metadata]
ScaleWithDPI=True ScaleWithDPI=True
[InputPanel] [InputPanel]
Font=Sans 13 Font=Sans 13
NormalColor=${fg0} NormalColor=@fg0@
HighlightCandidateColor=${fg1}; HighlightCandidateColor=@fg1@;
HighlightColor=${undefined} HighlightColor=@undefined@
HighlightBackgroundColor=${undefined} HighlightBackgroundColor=@undefined@
Spacing=3 Spacing=3
[InputPanel/TextMargin] [InputPanel/TextMargin]
@ -24,7 +16,7 @@ Top=6
Bottom=6 Bottom=6
[InputPanel/Background] [InputPanel/Background]
Color=${background} Color=@background@
[InputPanel/Background/Margin] [InputPanel/Background/Margin]
Left=2 Left=2
@ -33,7 +25,7 @@ Top=2
Bottom=2 Bottom=2
[InputPanel/Highlight] [InputPanel/Highlight]
Color=${highlight} Color=@highlight@
[InputPanel/Highlight/Margin] [InputPanel/Highlight/Margin]
Left=10 Left=10
@ -43,11 +35,11 @@ Bottom=7
[Menu] [Menu]
Font=Sans 10 Font=Sans 10
NormalColor=${fg0} NormalColor=@fg0@
Spacing=3 Spacing=3
[Menu/Background] [Menu/Background]
Color=${background} Color=@background@
[Menu/Background/Margin] [Menu/Background/Margin]
Left=2 Left=2
@ -62,7 +54,7 @@ Top=2
Bottom=2 Bottom=2
[Menu/Highlight] [Menu/Highlight]
Color=${highlight} Color=@highlight@
[Menu/Highlight/Margin] [Menu/Highlight/Margin]
Left=10 Left=10
@ -71,7 +63,7 @@ Top=5
Bottom=5 Bottom=5
[Menu/Separator] [Menu/Separator]
Color=${highlight} Color=@highlight@
[Menu/CheckBox] [Menu/CheckBox]
Image=radio.png Image=radio.png
@ -84,4 +76,3 @@ Left=5
Right=5 Right=5
Top=5 Top=5
Bottom=5 Bottom=5
''
Loading…
Cancel
Save