fcitx5: use upstream options (#1158)

Link: https://github.com/danth/stylix/pull/1158

Co-authored-by: awwpotato <awwpotato@voidq.com>
Tested-by: awwpotato <awwpotato@voidq.com>
Reviewed-by: awwpotato <awwpotato@voidq.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
Flameopathic 2025-04-30 20:49:42 -04:00 committed by GitHub
parent e11bc9a59d
commit 44957b251b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 252 additions and 251 deletions

6
flake.lock generated
View file

@ -224,11 +224,11 @@
]
},
"locked": {
"lastModified": 1745439012,
"narHash": "sha256-TwbdiH28QK7Da2JQTqFHdb+UCJq6QbF2mtf+RxHVzEA=",
"lastModified": 1745494811,
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d31710fb2cd536b1966fee2af74e99a0816a61a8",
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be",
"type": "github"
},
"original": {

View file

@ -10,22 +10,29 @@
config =
lib.mkIf (config.stylix.enable && config.stylix.targets.fcitx5.enable)
{
xdg = {
configFile."fcitx5/conf/classicui.conf".text = "Theme=stylix";
dataFile = {
i18n.inputMethod.fcitx5 = {
settings.addons.classicui.globalSection = with config.stylix.fonts; {
Theme = "stylix";
UseDarkTheme = false;
UseAccentColor = false;
Font = "${sansSerif.name} ${toString sizes.popups}";
MenuFont = "${sansSerif.name} ${toString sizes.popups}";
TrayFont = "${sansSerif.name} ${toString sizes.popups}";
};
themes.stylix = {
# Adapted from https://github.com/sanweiya/fcitx5-mellow-themes under the BSD 2 license (compatible with this project's license (MIT))
# Copyright (c) 2024, sanweiya
"fcitx5/themes/stylix/highlight.svg".source = config.lib.stylix.colors {
highlightImage = config.lib.stylix.colors {
template = ./highlight.svg.mustache;
extension = ".svg";
};
"fcitx5/themes/stylix/panel.svg".source = config.lib.stylix.colors {
panelImage = config.lib.stylix.colors {
template = ./panel.svg.mustache;
extension = ".svg";
};
"fcitx5/themes/stylix/theme.conf".source = config.lib.stylix.colors {
template = ./theme.conf.mustache;
extension = ".conf";
theme = import ./template.nix {
colors = config.lib.stylix.colors.withHashtag;
};
};
};

234
modules/fcitx5/template.nix Normal file
View file

@ -0,0 +1,234 @@
{ colors }:
with colors;
{
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;
HighlightCandidateColor = base06;
EnableBlur = false;
FullWidthHighlight = true;
HighlightColor = base04;
HighlightBackgroundColor = base0E;
};
"InputPanel/BlurMargin" = {
Left = 0;
Right = 0;
Top = 0;
Bottom = 0;
};
"InputPanel/Background" = {
Image = "panel.svg";
Color = base01;
BorderColor = base01;
BorderWidth = 0;
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;
BorderColor = base01 + "00";
BorderWidth = 0;
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" = {
};
"InputPanel/PrevPage/ClickMargin" = {
Left = 5;
Right = 5;
Top = 4;
Bottom = 4;
};
"InputPanel/NextPage" = {
};
"InputPanel/NextPage/ClickMargin" = {
Left = 5;
Right = 5;
Top = 4;
Bottom = 4;
};
"InputPanel/ShadowMargin" = {
Left = 0;
Right = 0;
Top = 0;
Bottom = 0;
};
Menu = {
NormalColor = base05;
HighlightCandidateColor = base02;
Spacing = 0;
};
"Menu/Background" = {
Image = "panel.svg";
Color = base01;
BorderColor = base01 + "00";
BorderWidth = 0;
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;
BorderColor = base05 + "00";
BorderWidth = 0;
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" = {
Color = base00;
BorderColor = base00 + "00";
BorderWidth = 0;
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;
BorderColor = base01 + "00";
BorderWidth = 0;
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;
BorderColor = base01 + "00";
BorderWidth = 0;
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;
};
}

View file

@ -1,240 +0,0 @@
[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