home/fcitx5: use home-manager module options for config
This commit is contained in:
@@ -8,6 +8,7 @@ in
|
|||||||
i18n.inputMethod = {
|
i18n.inputMethod = {
|
||||||
enable = true;
|
enable = true;
|
||||||
type = "fcitx5";
|
type = "fcitx5";
|
||||||
|
|
||||||
fcitx5 = {
|
fcitx5 = {
|
||||||
waylandFrontend = true;
|
waylandFrontend = true;
|
||||||
addons = with pkgs; [
|
addons = with pkgs; [
|
||||||
@@ -15,16 +16,12 @@ in
|
|||||||
fcitx5-gtk
|
fcitx5-gtk
|
||||||
# fcitx5-chinese-addons
|
# fcitx5-chinese-addons
|
||||||
];
|
];
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile = let
|
# TODO: fix logic upstream
|
||||||
format = pkgs.formats.iniWithGlobalSection { };
|
themes."Material-Color".theme = (builtins.readFile "${pkgs.fcitx5-material-color}/share/fcitx5/themes/Material-Color-orange/theme.conf");
|
||||||
in {
|
|
||||||
"fcitx5/profile" = {
|
settings = {
|
||||||
force = true;
|
inputMethod = {
|
||||||
source = format.generate "fcitx5-profile" {
|
|
||||||
sections = {
|
|
||||||
"Groups/0" = {
|
"Groups/0" = {
|
||||||
Name = "Default";
|
Name = "Default";
|
||||||
"Default Layout" = "us";
|
"Default Layout" = "us";
|
||||||
@@ -46,93 +43,84 @@ in
|
|||||||
"0" = "Default";
|
"0" = "Default";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
"fcitx5/config".source = format.generate "fcitx5-config" {
|
globalOptions = {
|
||||||
sections = {
|
Hotkey = {
|
||||||
Hotkey = {
|
# Enumerate when press trigger key repeatedly
|
||||||
# Enumerate when press trigger key repeatedly
|
EnumerateWithTriggerKeys = "True";
|
||||||
EnumerateWithTriggerKeys = "True";
|
# Temporally switch between first and current Input Method
|
||||||
# Temporally switch between first and current Input Method
|
AltTriggerKeys = "";
|
||||||
AltTriggerKeys = "";
|
# Enumerate Input Method Forward
|
||||||
# Enumerate Input Method Forward
|
EnumerateForwardKeys = "";
|
||||||
EnumerateForwardKeys = "";
|
# Enumerate Input Method Backward
|
||||||
# Enumerate Input Method Backward
|
EnumerateBackwardKeys = "";
|
||||||
EnumerateBackwardKeys = "";
|
# Skip first input method while enumerating
|
||||||
# Skip first input method while enumerating
|
EnumerateSkipFirst = "False";
|
||||||
EnumerateSkipFirst = "False";
|
};
|
||||||
|
|
||||||
|
"Hotkey/TriggerKeys" = {
|
||||||
|
"0" = "Control+space";
|
||||||
|
"1" = "Zenkaku_Hankaku";
|
||||||
|
"2" = "Hangul";
|
||||||
|
};
|
||||||
|
|
||||||
|
"Hotkey/EnumerateGroupForwardKeys"."0" = "Super+space";
|
||||||
|
"Hotkey/EnumerateGroupBackwardKeys"."0" = "Shift+Super+space";
|
||||||
|
"Hotkey/ActivateKeys"."0" = "Hangul_Hanja";
|
||||||
|
"Hotkey/DeactivateKeys"."0" = "Hangul_Romaja";
|
||||||
|
"Hotkey/PrevPage"."0" = "Up";
|
||||||
|
"Hotkey/NextPage"."0" = "Down";
|
||||||
|
"Hotkey/PrevCandidate"."0" = "Shift+Tab";
|
||||||
|
"Hotkey/NextCandidate"."0" = "Tab";
|
||||||
|
"Hotkey/TogglePreedit"."0" = "Control+Alt+P";
|
||||||
|
|
||||||
|
Behaviour = {
|
||||||
|
# Active By Default
|
||||||
|
ActiveByDefault = "False";
|
||||||
|
# Share Input State
|
||||||
|
ShareInputState = "All";
|
||||||
|
# Show preedit in application
|
||||||
|
PreeditEnabledByDefault = "True";
|
||||||
|
# Show Input Method Information when switch input method
|
||||||
|
ShowInputMethodInformation = "True";
|
||||||
|
# Show Input Method Information when changing focus
|
||||||
|
showInputMethodInformationWhenFocusIn = "False";
|
||||||
|
# Show compact input method information
|
||||||
|
CompactInputMethodInformation = "True";
|
||||||
|
# Show first input method information
|
||||||
|
ShowFirstInputMethodInformation = "True";
|
||||||
|
# Default page size
|
||||||
|
DefaultPageSize = 5;
|
||||||
|
# Override Xkb Option
|
||||||
|
OverrideXkbOption = "False";
|
||||||
|
# Custom Xkb Option
|
||||||
|
CustomXkbOption = "";
|
||||||
|
# Force Enabled Addons
|
||||||
|
EnabledAddons = "";
|
||||||
|
# Force Disabled Addons
|
||||||
|
DisabledAddons = "";
|
||||||
|
# Preload input method to be used by default
|
||||||
|
PreloadInputMethod = "True";
|
||||||
|
# Allow input method in the password field
|
||||||
|
AllowInputMethodForPassword = "False";
|
||||||
|
# Show preedit text when typing password
|
||||||
|
ShowPreeditForPassword = "False";
|
||||||
|
# Interval of saving user data in minutes
|
||||||
|
AutoSavePeriod = 30;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
"Hotkey/TriggerKeys" = {
|
addons.classicui.globalSection = {
|
||||||
"0" = "Control+space";
|
Theme = "Material-Color";
|
||||||
"1" = "Zenkaku_Hankaku";
|
PerScreenDPI = "True";
|
||||||
"2" = "Hangul";
|
# Font = "";
|
||||||
|
"Vertical Candidate List" = "True";
|
||||||
};
|
};
|
||||||
|
|
||||||
"Hotkey/EnumerateGroupForwardKeys"."0" = "Super+space";
|
|
||||||
"Hotkey/EnumerateGroupBackwardKeys"."0" = "Shift+Super+space";
|
|
||||||
"Hotkey/ActivateKeys"."0" = "Hangul_Hanja";
|
|
||||||
"Hotkey/DeactivateKeys"."0" = "Hangul_Romaja";
|
|
||||||
"Hotkey/PrevPage"."0" = "Up";
|
|
||||||
"Hotkey/NextPage"."0" = "Down";
|
|
||||||
"Hotkey/PrevCandidate"."0" = "Shift+Tab";
|
|
||||||
"Hotkey/NextCandidate"."0" = "Tab";
|
|
||||||
"Hotkey/TogglePreedit"."0" = "Control+Alt+P";
|
|
||||||
|
|
||||||
Behaviour = {
|
|
||||||
# Active By Default
|
|
||||||
ActiveByDefault = "False";
|
|
||||||
# Share Input State
|
|
||||||
ShareInputState = "All";
|
|
||||||
# Show preedit in application
|
|
||||||
PreeditEnabledByDefault = "True";
|
|
||||||
# Show Input Method Information when switch input method
|
|
||||||
ShowInputMethodInformation = "True";
|
|
||||||
# Show Input Method Information when changing focus
|
|
||||||
showInputMethodInformationWhenFocusIn = "False";
|
|
||||||
# Show compact input method information
|
|
||||||
CompactInputMethodInformation = "True";
|
|
||||||
# Show first input method information
|
|
||||||
ShowFirstInputMethodInformation = "True";
|
|
||||||
# Default page size
|
|
||||||
DefaultPageSize = 5;
|
|
||||||
# Override Xkb Option
|
|
||||||
OverrideXkbOption = "False";
|
|
||||||
# Custom Xkb Option
|
|
||||||
CustomXkbOption = "";
|
|
||||||
# Force Enabled Addons
|
|
||||||
EnabledAddons = "";
|
|
||||||
# Force Disabled Addons
|
|
||||||
DisabledAddons = "";
|
|
||||||
# Preload input method to be used by default
|
|
||||||
PreloadInputMethod = "True";
|
|
||||||
# Allow input method in the password field
|
|
||||||
AllowInputMethodForPassword = "False";
|
|
||||||
# Show preedit text when typing password
|
|
||||||
ShowPreeditForPassword = "False";
|
|
||||||
# Interval of saving user data in minutes
|
|
||||||
AutoSavePeriod = 30;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
"fcitx5/conf/classicui.conf".source = format.generate "fcitx5-classicui.conf" {
|
|
||||||
globalSection = {
|
|
||||||
Theme = "Material-Color";
|
|
||||||
PerScreenDPI = "True";
|
|
||||||
# Font = "";
|
|
||||||
"Vertical Candidate List" = "True";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.dataFile."fcitx5/themes/Material-Color" = {
|
systemd.user.services.fcitx5-daemon = lib.mkIf (im.enable && im.type == "fcitx5") {
|
||||||
recursive = true;
|
|
||||||
source = "${pkgs.fcitx5-material-color}/share/fcitx5/themes/Material-Color-orange";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.fcitx5-daemon = {
|
|
||||||
Service.Restart="on-failure";
|
Service.Restart="on-failure";
|
||||||
Service.ExecStart = lib.mkForce "${fcitx5Package}/bin/fcitx5";
|
Service.ExecStart = lib.mkForce "${fcitx5Package}/bin/fcitx5";
|
||||||
Service.ExecReload = "/bin/kill -HUP $MAINPID";
|
Service.ExecReload = "/bin/kill -HUP $MAINPID";
|
||||||
|
Reference in New Issue
Block a user