Fcitx5: Difference between revisions

Jasi (talk | contribs)
m Change addon to add-ons for consistency
Ardenet (talk | contribs)
Prepared the page for translation
Line 1: Line 1:
<languages/>
<translate>
[https://fcitx-im.org/wiki/Fcitx_5 Fcitx5] is a lightweight input method framework with add-on support.
[https://fcitx-im.org/wiki/Fcitx_5 Fcitx5] is a lightweight input method framework with add-on support.


Line 6: Line 8:


The following is a snippet for a NixOS configuration that sets up fcitx5, its GUI config tool, and two add-ons.
The following is a snippet for a NixOS configuration that sets up fcitx5, its GUI config tool, and two add-ons.
</translate>
{{File|3={
{{File|3={
   i18n.inputMethod = {
   i18n.inputMethod = {
Line 16: Line 19:
   };
   };
}|name=/etc/nixos/configuration.nix|lang=nix}}
}|name=/etc/nixos/configuration.nix|lang=nix}}
<translate>


== Configuration ==
== Configuration ==
Fcitx5 can be configured declaratively (though this is <strong>optional</strong>) using {{nixos:option|i18n.inputMethod.fcitx5.settings}} or [https://home-manager-options.extranix.com/?query=i18n.inputMethod.fcitx5.settings i18n.inputMethod.fcitx5.settings] ([[Home Manager]]). The former generates a config file in {{ic|/etc/xdg/fcitx5}} and the latter in {{ic|~/.config/fcitx5}}.
 
Fcitx5 can be configured declaratively (though this is <strong>optional</strong>) using {{nixos:option|i18n.inputMethod.fcitx5.settings}} or [https://home-manager-options.extranix.com/?query=i18n.inputMethod.fcitx5.settings i18n.inputMethod.fcitx5.settings] ([[Special:MyLanguage/Home Manager|Home Manager]]). The former generates a config file in {{ic|/etc/xdg/fcitx5}} and the latter in {{ic|~/.config/fcitx5}}.


It would be easier to edit the Fcitx5 profile through GUI tools (i.e. {{nixos:package|kdePackages.fcitx5-configtool}}) [https://wiki.archlinux.org/title/Fcitx5#Configuration_tool as recommended in Arch Wiki], then convert the generated configuration files to Nix configuration;  
It would be easier to edit the Fcitx5 profile through GUI tools (i.e. {{nixos:package|kdePackages.fcitx5-configtool}}) [https://wiki.archlinux.org/title/Fcitx5#Configuration_tool as recommended in Arch Wiki], then convert the generated configuration files to Nix configuration;  
Line 25: Line 30:
* {{ic|cat ~/.config/fcitx5/config}} (if exists) to {{ic|i18n.inputMethod.fcitx5.settings.globalOptions}}
* {{ic|cat ~/.config/fcitx5/config}} (if exists) to {{ic|i18n.inputMethod.fcitx5.settings.globalOptions}}


</translate>
{{file|configuration.nix or home.nix|nix|3=
{{file|configuration.nix or home.nix|nix|3=
i18n.inputMethod.fcitx5.settings.inputMethod = {
i18n.inputMethod.fcitx5.settings.inputMethod = {
Line 41: Line 47:
# i18n.inputMethod.fcitx5.ignoreUserConfig = true;
# i18n.inputMethod.fcitx5.ignoreUserConfig = true;
}}
}}
<translate>


== Troubleshooting ==
== Troubleshooting ==
=== Add-ons Not Detected ===
=== Add-ons Not Detected ===
'''Do not''' install fcitx5 using <code>environment.systemPackages</code> can interfere with add-on detection. Make sure to only add fcitx5 to your config as shown in [[Fcitx5#Setup | Setup]].


[[File:Fcitx5-mozc-load-fail.jpg|thumb|Fcitx5 failing to load IME module (claims "使用不可" (unusable))]]
'''Do not''' install fcitx5 using <code>environment.systemPackages</code> can interfere with add-on detection. Make sure to only add fcitx5 to your config as shown in [[Special:MyLanguage/Fcitx5#Setup | Setup]].


Another possibility is that you are calling <code>${pkgs.fcitx5}/bin/fcitx5</code> instead of the patched <code>fcitx5-with-addons</code> (<code>/run/current-system/sw/bin/fcitx5</code>). For example in [[Hyprland]]:
</translate>
[[File:Fcitx5-mozc-load-fail.jpg|thumb|<translate>Fcitx5 failing to load IME module (claims "使用不可" (unusable))</translate>]]
<translate>
 
Another possibility is that you are calling <code>${pkgs.fcitx5}/bin/fcitx5</code> instead of the patched <code>fcitx5-with-addons</code> (<code>/run/current-system/sw/bin/fcitx5</code>). For example in [[Special:MyLanguage/Hyprland|Hyprland]]:


   # ~/.config/hypr/hyprland.conf
   # ~/.config/hypr/hyprland.conf
Line 54: Line 65:


=== Fcitx5 Doesn't Start When Using WM ===
=== Fcitx5 Doesn't Start When Using WM ===
If using a Window Manager (WM), such as [[Sway]], you may need to add <code>services.xserver.desktopManager.runXdgAutostartIfNone = true;</code> to your NixOS configuration.
 
If using a Window Manager (WM), such as [[Special:MyLanguage/Sway|Sway]], you may need to add <code>services.xserver.desktopManager.runXdgAutostartIfNone = true;</code> to your NixOS configuration.


=== Using Wayland ===
=== Using Wayland ===
Set boolean <code>i18n.inputMethod.fcitx5.waylandFrontend</code> to true to suppress warnings about environment variables.
Set boolean <code>i18n.inputMethod.fcitx5.waylandFrontend</code> to true to suppress warnings about environment variables.


For more details on how to correctly set fcitx5 for different compositors and applications, refer to the [https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland fcitx5 wiki].
For more details on how to correctly set fcitx5 for different compositors and applications, refer to the [https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland fcitx5 wiki].


[[Category:Applications]]
</translate>
[[Category:Applications{{#translation:}}]]