diff --git a/modules/fcitx5/highlight.svg.mustache b/modules/fcitx5/highlight.svg.mustache new file mode 100644 index 00000000..783e1c98 --- /dev/null +++ b/modules/fcitx5/highlight.svg.mustache @@ -0,0 +1,84 @@ + + + + + + + + + diff --git a/modules/fcitx5/hm.nix b/modules/fcitx5/hm.nix new file mode 100644 index 00000000..5ee1619f --- /dev/null +++ b/modules/fcitx5/hm.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + ... +}: let + # Adapted from https://github.com/sanweiya/fcitx5-mellow-themes under the BSD 2 license (compatible with this project's license (MIT)) + theme = config.lib.stylix.colors { + template = ./theme.conf.mustache; + extension = "conf"; + }; + highlight = config.lib.stylix.colors { + template = ./highlight.svg.mustache; + extension = "svg"; + }; + panel = config.lib.stylix.colors { + template = ./panel.svg.mustache; + extension = "svg"; + }; +in { + options.stylix.targets.fcitx5.enable = + config.lib.stylix.mkEnableTarget "fcitx5" true; + + config = + lib.mkIf + (config.stylix.enable && config.stylix.targets.fcitx5.enable) + { + xdg.dataFile = { + "fcitx5/themes/stylix/highlight.svg".source = highlight; + "fcitx5/themes/stylix/panel.svg".source = panel; + "fcitx5/themes/stylix/theme.conf".source = theme; + }; + }; +} diff --git a/modules/fcitx5/panel.svg.mustache b/modules/fcitx5/panel.svg.mustache new file mode 100644 index 00000000..c3e06596 --- /dev/null +++ b/modules/fcitx5/panel.svg.mustache @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + Layer 1 + + + diff --git a/modules/fcitx5/theme.conf.mustache b/modules/fcitx5/theme.conf.mustache new file mode 100644 index 00000000..60fa0400 --- /dev/null +++ b/modules/fcitx5/theme.conf.mustache @@ -0,0 +1,240 @@ +[Metadata] +Name=Stylix +Version=0.1 +Author="sanweiya and ontake (make-42)" +Description="Stylix fcitx5 theme based on the mellow-themes by sanweiya" + +[InputPanel] +NormalColor=#{{base05-hex}} +HighlightCandidateColor=#{{base04-hex}} +EnableBlur=False +BlurMask= +FullWidthHighlight=True +HighlightColor=#{{base04-hex}} +HighlightBackgroundColor=#{{base0E-hex}} + +[InputPanel/BlurMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[InputPanel/Background] +Image=panel.svg +Color=#{{base01-hex}} +BorderColor=#{{base01-hex}} +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[InputPanel/Background/Margin] +Left=15 +Right=15 +Top=15 +Bottom=15 + +[InputPanel/Background/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[InputPanel/Highlight] +Image=highlight.svg +Color=#{{base01-hex}} +BorderColor=#{{base01-hex}}00 +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[InputPanel/Highlight/Margin] +Left=15 +Right=15 +Top=10 +Bottom=10 + +[InputPanel/Highlight/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[InputPanel/Highlight/HighlightClickMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[InputPanel/ContentMargin] +Left=9 +Right=9 +Top=7 +Bottom=7 + +[InputPanel/TextMargin] +Left=9 +Right=9 +Top=6 +Bottom=7 + +[InputPanel/PrevPage] +Image= + +[InputPanel/PrevPage/ClickMargin] +Left=5 +Right=5 +Top=4 +Bottom=4 + +[InputPanel/NextPage] +Image= + +[InputPanel/NextPage/ClickMargin] +Left=5 +Right=5 +Top=4 +Bottom=4 + +[InputPanel/ShadowMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu] +NormalColor=#{{base05-hex}} +HighlightCandidateColor=#{{base02-hex}} +Spacing=0 + +[Menu/Background] +Image=panel.svg +Color=#{{base01-hex}} +BorderColor=#{{base01-hex}}00 +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[Menu/Background/Margin] +Left=11 +Right=11 +Top=11 +Bottom=11 + +[Menu/Background/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/Highlight] +Image=highlight.svg +Color=#{{base05-hex}} +BorderColor=#{{base05-hex}}00 +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[Menu/Highlight/Margin] +Left=5 +Right=5 +Top=5 +Bottom=5 + +[Menu/Highlight/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/Separator] +Image= +Color=#{{base00-hex}} +BorderColor=#{{base00-hex}}00 +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[Menu/Separator/Margin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/Separator/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/CheckBox] +Image=radio.svg +Color=#{{base01-hex}} +BorderColor=#{{base01-hex}}00 +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[Menu/CheckBox/Margin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/CheckBox/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/SubMenu] +Image=arrow.svg +Color=#{{base01-hex}} +BorderColor=#{{base01-hex}}00 +BorderWidth=0 +Overlay= +Gravity="Top Left" +OverlayOffsetX=0 +OverlayOffsetY=0 +HideOverlayIfOversize=False + +[Menu/SubMenu/Margin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/SubMenu/OverlayClipMargin] +Left=0 +Right=0 +Top=0 +Bottom=0 + +[Menu/ContentMargin] +Left=11 +Right=11 +Top=11 +Bottom=11 + +[Menu/TextMargin] +Left=6 +Right=6 +Top=6 +Bottom=6