Fcitx5: Difference between revisions

From NixOS Wiki
JMoogs (talk | contribs)
m Fixed typo
34j (talk | contribs)
Add new case for "Add-ons Not Detected"
 
(3 intermediate revisions by 3 users not shown)
Line 2: Line 2:


== 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'll setup fcitx5, its GUI config tool, and two addons.


  i18n.inputMethod = {
  i18n.inputMethod = {
Line 12: Line 12:
  };
  };


Notably, NixOs automagically sets session variables that are required for fcitx5.  
Notably, NixOS automagically sets session variables that are required for fcitx5.  


== Troubleshooting ==
== Troubleshooting ==
=== Add-ons Not Detected ===
=== Add-ons Not Detected ===
Installing 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]].
Installing 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))]]
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]]:
  # ~/.config/hypr/hyprland.conf
  exec-once=fcitx5 -d # not ${pkgs.fcitx5}/bin/fcitx5 !


=== 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.
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 = true;</code> to your NixOS configuration.


See the [https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11 NixOS 23.11 Release Notes] for more information.
See the [https://nixos.org/manual/nixos/stable/release-notes#sec-release-23.11 NixOS 23.11 Release Notes] for more information.
=== Using Wayland ===
Set boolean <code>i18n.inputMethod.fcitx5.waylandFrontend</code> to true to suppress warnings about environment variables.


[[Category:Applications]]
[[Category:Applications]]

Latest revision as of 15:31, 23 November 2024

Fcitx5 is a lightweight input method framework with addon support.

Setup

The following is a simple NixOS configuration that'll setup fcitx5, its GUI config tool, and two addons.

i18n.inputMethod = {
    enabled = "fcitx5";
    fcitx5.addons = with pkgs; [
        fcitx5-mozc
        fcitx5-gtk
    ];
};

Notably, NixOS automagically sets session variables that are required for fcitx5.

Troubleshooting

Add-ons Not Detected

Installing fcitx5 using environment.systemPackages can interfere with add-on detection. Make sure to only add fcitx5 to your config as shown in Setup.

Fcitx5 failing to load IME module (claims "使用不可" (unusable))

Another possibility is that you are calling ${pkgs.fcitx5}/bin/fcitx5 instead of the patched fcitx5-with-addons (/run/current-system/sw/bin/fcitx5). For example in Hyprland:

 # ~/.config/hypr/hyprland.conf
 exec-once=fcitx5 -d # not ${pkgs.fcitx5}/bin/fcitx5 !

Fcitx5 Doesn't Start When Using WM

As of NixOS 23.11 i18n.inputMethod.enabled 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 services.xserver.desktopManager.runXdgAutostartIfNone = true; to your NixOS configuration.

See the NixOS 23.11 Release Notes for more information.

Using Wayland

Set boolean i18n.inputMethod.fcitx5.waylandFrontend to true to suppress warnings about environment variables.