Fcitx5: Difference between revisions

imported>Tamiyo
additional clarity around add-ons not detected
Crdr (talk | contribs)
Added references to the upstream fcitx5 wiki
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Fcitx5 is a lightweight input method framework with addon support.
[https://fcitx-im.org/wiki/Fcitx_5 Fcitx5] is a lightweight input method framework with addon support.


== Setup ==
== Setup ==
The following is a simple NixOs configuration that'll setup fcitx5, its GUI config tool, and two addons.
The following is a simple NixOS configuration that sets up fcitx5, its GUI config tool, and two addons.<syntaxhighlight lang="nix">
i18n.inputMethod = {
  enable = true;
  type = "fcitx5";
  fcitx5.addons = with pkgs; [ fcitx5-mozc fcitx5-gtk ];
};
</syntaxhighlight>Notably, NixOS automagically sets session variables that are required for fcitx5.  


i18n.inputMethod = {
== Troubleshooting ==
    enabled = "fcitx5";
=== Add-ons Not Detected ===
    fcitx5.addons = with pkgs; [
'''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]].
        fcitx5-mozc
 
        fcitx5-gtk
[[File:Fcitx5-mozc-load-fail.jpg|thumb|Fcitx5 failing to load IME module (claims "使用不可" (unusable))]]
    ];
};


Notably, NixOs automagically sets session variables that are required for fcitx5.  
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]]:


== Troubleshooting ==
  # ~/.config/hypr/hyprland.conf
=== Add-ons Not Detected ===
  exec-once=fcitx5 -d # not ${pkgs.fcitx5}/bin/fcitx5 !
Installing fcitx5 using <code>environment.systemPackages</code> can interfere with add-on detection. Make sure to only add fcitx5 to your config as show in [[Fcitx5#Setup | Setup]].


=== Fcitx5 Doesn't Start When Using WM ===
=== Fcitx5 Doesn't Start When Using WM ===
As of NixOS 23.11 <code>i18n.inputMethod.enabled</code> no longer creates systemd services for fcitx5. Instead it relies on XDG autostart files. If using a Window Manager (WM), such as [[Sway]], you may need to add <code>services.xserver.desktopManager.runXdgAutoStartIfNone</code> to your NixOS configuration.
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.
 
=== Using Wayland ===
Set boolean <code>i18n.inputMethod.fcitx5.waylandFrontend</code> to true to suppress warnings about environment variables.


See the [https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11 NixOS 23.11 Release Notes] for more information.
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]]
[[Category:Applications]]