1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

fcitx5: add upstream options (#6892)

This commit is contained in:
awwpotato 2025-04-23 09:51:43 -07:00 committed by GitHub
parent 59de2dfb0a
commit 6d1f834ca6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 281 additions and 75 deletions

View file

@ -1,5 +1,5 @@
{
input-method-fcitx5-configuration = ./fcitx5-configuration.nix;
input-method-fcitx5-old-enable = ./fcitx5-configuration.nix;
input-method-fcitx5-configuration = ./fcitx5/configuration.nix;
input-method-fcitx5-old-enable = ./fcitx5/old-enable.nix;
input-method-kime-configuration = ./kime-configuration.nix;
}

View file

@ -1,37 +0,0 @@
{
config,
lib,
realPkgs,
...
}:
lib.mkIf config.test.enableBig {
i18n.inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
themes.example = {
theme = ''
[Metadata]
Name=example
Version=0.1
Author=home-manager
Description=Theme for testing
ScaleWithDPI=True
'';
};
classicUiConfig = "Theme=example";
};
};
_module.args.pkgs = lib.mkForce realPkgs;
nmt.script = ''
assertFileExists home-files/.config/systemd/user/fcitx5-daemon.service
assertFileExists home-files/.local/share/fcitx5/themes/example/theme.conf
assertFileExists home-files/.local/share/fcitx5/conf/classicui.conf
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh 'GTK_IM_MODULE'
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh 'QT_IM_MODULE'
'';
}

View file

@ -0,0 +1,2 @@
Theme=example

View file

@ -0,0 +1,20 @@
[Behavior]
ActiveByDefault=false
AllowInputMethodForPassword=false
AutoSavePeriod=30
CompactInputMethodInformation=true
DefaultPageSize=5
OverrideXkbOption=false
PreeditEnabledByDefault=true
PreloadInputMethod=true
ShareInputState=No
ShowFirstInputMethodInformation=true
ShowInputMethodInformation=true
ShowPreeditForPassword=false
resetStateWhenFocusIn=No
showInputMethodInformationWhenFocusIn=false
[Hotkey]
EnumerateSkipFirst=false
EnumerateWithTriggerKeys=true
ModifierOnlyKeyTimeout=250

View file

@ -0,0 +1,83 @@
{
config,
lib,
realPkgs,
...
}:
lib.mkIf config.test.enableBig {
i18n.inputMethod = {
enable = true;
type = "fcitx5";
fcitx5 = {
waylandFrontend = true;
settings = {
globalOptions = {
Behavior = {
ActiveByDefault = false;
resetStateWhenFocusIn = "No";
ShareInputState = "No";
PreeditEnabledByDefault = true;
ShowInputMethodInformation = true;
showInputMethodInformationWhenFocusIn = false;
CompactInputMethodInformation = true;
ShowFirstInputMethodInformation = true;
DefaultPageSize = 5;
OverrideXkbOption = false;
PreloadInputMethod = true;
AllowInputMethodForPassword = false;
ShowPreeditForPassword = false;
AutoSavePeriod = 30;
};
Hotkey = {
EnumerateWithTriggerKeys = true;
EnumerateSkipFirst = false;
ModifierOnlyKeyTimeout = 250;
};
};
inputMethod = {
GroupOrder."0" = "Default";
"Groups/0" = {
Name = "Default";
"Default Layout" = "us";
DefaultIM = "pinyin";
};
"Groups/0/Items/0" = {
Name = "keyboard-us";
Layout = null;
};
"Groups/0/Items/1" = {
Name = "pinyin";
Layout = null;
};
};
addons.classicui.globalSection.Theme = "example";
};
themes.example = {
theme = ''
[Metadata]
Name=example
Version=0.1
Author=home-manager
Description=Theme for testing
ScaleWithDPI=True
'';
};
};
};
_module.args.pkgs = lib.mkForce realPkgs;
nmt.script = ''
assertFileExists home-files/.config/systemd/user/fcitx5-daemon.service
assertFileExists home-files/.config/fcitx5/config
assertFileContent home-files/.config/fcitx5/config ${./config}
assertFileExists home-files/.config/fcitx5/profile
assertFileContent home-files/.config/fcitx5/profile ${./profile}
assertFileExists home-files/.config/fcitx5/conf/classicui.conf
assertFileContent home-files/.config/fcitx5/conf/classicui.conf ${./classicui.conf}
assertFileExists home-files/.local/share/fcitx5/themes/example/theme.conf
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh 'GTK_IM_MODULE'
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh 'QT_IM_MODULE'
'';
}

View file

@ -0,0 +1,15 @@
[GroupOrder]
0=Default
[Groups/0]
Default Layout=us
DefaultIM=pinyin
Name=Default
[Groups/0/Items/0]
Layout=null
Name=keyboard-us
[Groups/0/Items/1]
Layout=null
Name=pinyin