<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://fcitx-im.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Winson</id>
	<title>Fcitx - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://fcitx-im.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Winson"/>
	<link rel="alternate" type="text/html" href="https://fcitx-im.org/wiki/Special:Contributions/Winson"/>
	<updated>2026-05-03T09:21:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=46003</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=46003"/>
		<updated>2024-01-11T19:16:00Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ 针对 Fedora 36 KDE 的操作说明]。 这个操作说明应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora package]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== 非 XDG 兼容的窗口管理器/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&lt;br /&gt;
&lt;br /&gt;
如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&lt;br /&gt;
&lt;br /&gt;
另请注意，weston 有一个 bug，在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY，或使用 OpenX11Connection dbus 调用来连接 fcitx。&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
此[https://youtu.be/8XDmLr6wb4M 视频]演示了如何在 Archlinux 上手动设置环境变量&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/7/zh-cn&amp;diff=46002</id>
		<title>Translations:Setup Fcitx 5/7/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/7/zh-cn&amp;diff=46002"/>
		<updated>2024-01-11T19:16:00Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora package]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45986</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45986"/>
		<updated>2023-12-07T04:20:24Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== 非 XDG 兼容的窗口管理器/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&lt;br /&gt;
&lt;br /&gt;
如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&lt;br /&gt;
&lt;br /&gt;
另请注意，weston 有一个 bug，在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY，或使用 OpenX11Connection dbus 调用来连接 fcitx。&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/13/zh-cn&amp;diff=45985</id>
		<title>Translations:Setup Fcitx 5/13/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/13/zh-cn&amp;diff=45985"/>
		<updated>2023-12-07T04:20:24Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 非 XDG 兼容的窗口管理器/Wayland Compoistor ==&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45984</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45984"/>
		<updated>2023-12-07T04:19:14Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;另请注意，weston 有一个 bug，在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY，或使...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&lt;br /&gt;
&lt;br /&gt;
如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&lt;br /&gt;
&lt;br /&gt;
另请注意，weston 有一个 bug，在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY，或使用 OpenX11Connection dbus 调用来连接 fcitx。&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/20/zh-cn&amp;diff=45983</id>
		<title>Translations:Setup Fcitx 5/20/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/20/zh-cn&amp;diff=45983"/>
		<updated>2023-12-07T04:19:14Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;另请注意，weston 有一个 bug，在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY，或使...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;另请注意，weston 有一个 bug，在首次运行时不会正确设置 DISPLAY 为输入法。您可能需要终止 fcitx5 一次才能使其正确设置 DISPLAY，或使用 OpenX11Connection dbus 调用来连接 fcitx。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45982</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45982"/>
		<updated>2023-12-07T04:16:51Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&lt;br /&gt;
&lt;br /&gt;
如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/19/zh-cn&amp;diff=45981</id>
		<title>Translations:Setup Fcitx 5/19/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/19/zh-cn&amp;diff=45981"/>
		<updated>2023-12-07T04:16:51Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;如果你出于调试目的只在 X11 中运行 weston，最简单的方法是在启动 weston 前退出 fcitx5.&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45980</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45980"/>
		<updated>2023-12-07T04:15:41Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/18/zh-cn&amp;diff=45979</id>
		<title>Translations:Setup Fcitx 5/18/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/18/zh-cn&amp;diff=45979"/>
		<updated>2023-12-07T04:15:41Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;如果你已经在同一个会话中运行 fcitx5，当你为了调试和 fcitx5 尝试在 nested mode 中使用 weston 时，会存在特定的问题。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/17/zh-cn&amp;diff=45978</id>
		<title>Translations:Setup Fcitx 5/17/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/17/zh-cn&amp;diff=45978"/>
		<updated>2023-12-07T04:13:43Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;&amp;lt;nowiki&amp;gt;[input-method] path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45977</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45977"/>
		<updated>2023-12-07T04:13:34Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/16/zh-cn&amp;diff=45976</id>
		<title>Translations:Setup Fcitx 5/16/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/16/zh-cn&amp;diff=45976"/>
		<updated>2023-12-07T04:13:34Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;如果你希望使用 westons zwp_input_method_v1 实现，你需要确保以下内容存在 ~/.config/weston.ini 文件中（如果路径不是  /usr/bin/fcitx5 请做相应修改）。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45975</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45975"/>
		<updated>2023-12-07T04:12:16Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== Weston === Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/15/zh-cn&amp;diff=45974</id>
		<title>Translations:Setup Fcitx 5/15/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/15/zh-cn&amp;diff=45974"/>
		<updated>2023-12-07T04:12:16Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== Weston === Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Weston ===&lt;br /&gt;
Weston 是一个 wayland compositor 的参考实现，并不是普通用户的常规配置。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45973</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45973"/>
		<updated>2023-12-07T04:11:21Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/14/zh-cn&amp;diff=45972</id>
		<title>Translations:Setup Fcitx 5/14/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/14/zh-cn&amp;diff=45972"/>
		<updated>2023-12-07T04:11:21Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;在不支持 XDG Autostart 的场景中，请检查你的窗口管理器的手册中关于如何在系统启动时自动运行应用程序的方法。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/13/zh-cn&amp;diff=45971</id>
		<title>Translations:Setup Fcitx 5/13/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/13/zh-cn&amp;diff=45971"/>
		<updated>2023-12-07T04:10:04Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;== Non-XDG compliant Window Manager/Wayland Compoistor ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45970</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45970"/>
		<updated>2023-12-07T04:09:47Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/12/zh-cn&amp;diff=45969</id>
		<title>Translations:Setup Fcitx 5/12/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/12/zh-cn&amp;diff=45969"/>
		<updated>2023-12-07T04:09:46Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;打开 systemsettings，转到 &amp;quot;Virtual Keyboard&amp;quot;  部分，将输入法从 &amp;quot;None&amp;quot; 改为 &amp;quot;Fcitx 5&amp;quot;&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45968</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45968"/>
		<updated>2023-12-07T04:08:29Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;== KWin Wayland 5.24+ == 如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/11/zh-cn&amp;diff=45967</id>
		<title>Translations:Setup Fcitx 5/11/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/11/zh-cn&amp;diff=45967"/>
		<updated>2023-12-07T04:08:29Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;== KWin Wayland 5.24+ == 如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== KWin Wayland 5.24+ ==&lt;br /&gt;
如果你只使用 Gtk/Qt/Xwayland 应用，那么你不需要这里的操作。如果你希望使用支持 text-input-v3 的原生 wayland 应用，则需要让 KWin 将输入法作为一个特殊的客户端启动。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/10/zh-cn&amp;diff=45966</id>
		<title>Translations:Setup Fcitx 5/10/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/10/zh-cn&amp;diff=45966"/>
		<updated>2023-12-07T04:05:59Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;&amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45965</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45965"/>
		<updated>2023-12-07T04:05:41Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autos...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/9/zh-cn&amp;diff=45964</id>
		<title>Translations:Setup Fcitx 5/9/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/9/zh-cn&amp;diff=45964"/>
		<updated>2023-12-07T04:05:41Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autos...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;特定的发行版可能没有提供这个文件，如未提供，你可以直接复制 &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; 到 &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45963</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45963"/>
		<updated>2023-12-07T04:03:28Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/6/zh-cn&amp;diff=45962</id>
		<title>Translations:Setup Fcitx 5/6/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/6/zh-cn&amp;diff=45962"/>
		<updated>2023-12-07T04:03:28Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[Video instruction for Fedora 36 KDE]. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45961</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45961"/>
		<updated>2023-12-07T04:03:20Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/7/zh-cn&amp;diff=45960</id>
		<title>Translations:Setup Fcitx 5/7/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/7/zh-cn&amp;diff=45960"/>
		<updated>2023-12-07T04:03:20Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45959</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45959"/>
		<updated>2023-12-07T04:03:11Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== fcitx5-autostart (Fedora) === 这是一个 [ fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [ fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/7/zh-cn&amp;diff=45958</id>
		<title>Translations:Setup Fcitx 5/7/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/7/zh-cn&amp;diff=45958"/>
		<updated>2023-12-07T04:03:11Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== fcitx5-autostart (Fedora) === 这是一个 [ fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
这是一个 [ fedora 软件包]，打包了一个用于设置环境变量和 XDG autostart file 的 /etc/profile.d 脚本，可用于自启动。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45957</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45957"/>
		<updated>2023-12-07T03:56:25Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/6/zh-cn&amp;diff=45956</id>
		<title>Translations:Setup Fcitx 5/6/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/6/zh-cn&amp;diff=45956"/>
		<updated>2023-12-07T03:56:25Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;. 这个向导应该适用于除 GNOME 外的 XDG 兼容桌面。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/8/zh-cn&amp;diff=45955</id>
		<title>Translations:Setup Fcitx 5/8/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/8/zh-cn&amp;diff=45955"/>
		<updated>2023-12-07T03:51:47Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;== XDG Autostart ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== XDG Autostart ==&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45954</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45954"/>
		<updated>2023-12-07T03:47:30Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== imsettings (Fedora) === 这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/5/zh-cn&amp;diff=45953</id>
		<title>Translations:Setup Fcitx 5/5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/5/zh-cn&amp;diff=45953"/>
		<updated>2023-12-07T03:47:30Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== imsettings (Fedora) === 这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== imsettings (Fedora) ===&lt;br /&gt;
这是一个与 im-config 类似的程序，它也提供了 GUI 来选择要使用的输入法框架。imsettings 应该是被默认安装的，如果没有，你可以手动安装它。imsettings 可以设置环境变量并且启动相应的输入法，它还提供了一个图形化的前端用于修改配置。你需要做的就是简单地执行&amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;，log-out 然后再次 log-in。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45952</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45952"/>
		<updated>2023-12-07T03:42:19Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== im-config (Debian/Debian-based/Ubuntu) === 这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/co...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute &amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;, log-out and log-in again.&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/4/zh-cn&amp;diff=45951</id>
		<title>Translations:Setup Fcitx 5/4/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/4/zh-cn&amp;diff=45951"/>
		<updated>2023-12-07T03:42:19Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;=== im-config (Debian/Debian-based/Ubuntu) === 这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/co...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
这是一个用于 Debian 和 Debian-based 发行版的工具。在登录到 GUI 之后，从命令行执行 &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt;，应该会弹出一个向导程序，在其中选择 fcitx5 即可。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45950</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45950"/>
		<updated>2023-12-07T03:40:04Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
This is a tool used by debian or debian based distribution. Just run &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt; from command line after login to your graphics interface and it should pop up a wizard, just select fcitx5 from it.&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute &amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;, log-out and log-in again.&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/3/zh-cn&amp;diff=45949</id>
		<title>Translations:Setup Fcitx 5/3/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/3/zh-cn&amp;diff=45949"/>
		<updated>2023-12-07T03:40:03Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;特定的发行版可能会提供一些用于自动启动 Fcitx 的工具，并且这些工具通常也会设置环境变量。&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45948</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45948"/>
		<updated>2023-12-07T03:39:10Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;== 特定发行版中的工具 ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== 特定发行版中的工具 ==&lt;br /&gt;
&lt;br /&gt;
Distribution may provides some specific tool for autostart Fcitx and usually also set up environment variable together.&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
This is a tool used by debian or debian based distribution. Just run &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt; from command line after login to your graphics interface and it should pop up a wizard, just select fcitx5 from it.&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute &amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;, log-out and log-in again.&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/2/zh-cn&amp;diff=45947</id>
		<title>Translations:Setup Fcitx 5/2/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/2/zh-cn&amp;diff=45947"/>
		<updated>2023-12-07T03:39:10Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;== 特定发行版中的工具 ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 特定发行版中的工具 ==&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45946</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45946"/>
		<updated>2023-12-07T03:38:33Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;= 开机自启动 =&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= 开机自启动 =&lt;br /&gt;
&lt;br /&gt;
== Distribution specific tool ==&lt;br /&gt;
&lt;br /&gt;
Distribution may provides some specific tool for autostart Fcitx and usually also set up environment variable together.&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
This is a tool used by debian or debian based distribution. Just run &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt; from command line after login to your graphics interface and it should pop up a wizard, just select fcitx5 from it.&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute &amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;, log-out and log-in again.&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/1/zh-cn&amp;diff=45945</id>
		<title>Translations:Setup Fcitx 5/1/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/1/zh-cn&amp;diff=45945"/>
		<updated>2023-12-07T03:38:33Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;= 开机自启动 =&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= 开机自启动 =&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45944</id>
		<title>Setup Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5/zh-cn&amp;diff=45944"/>
		<updated>2023-12-07T03:37:58Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;设置 Fcitx 5&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
= Autostart =&lt;br /&gt;
&lt;br /&gt;
== Distribution specific tool ==&lt;br /&gt;
&lt;br /&gt;
Distribution may provides some specific tool for autostart Fcitx and usually also set up environment variable together.&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) ===&lt;br /&gt;
This is a tool used by debian or debian based distribution. Just run &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt; from command line after login to your graphics interface and it should pop up a wizard, just select fcitx5 from it.&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) ===&lt;br /&gt;
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute &amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;, log-out and log-in again.&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) ===&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart ==&lt;br /&gt;
&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ ==&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor ==&lt;br /&gt;
&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston ===&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables =&lt;br /&gt;
&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile ==&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile ==&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile ==&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d ==&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so ==&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh ==&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup ==&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus =&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 =&lt;br /&gt;
&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/Page_display_title/zh-cn&amp;diff=45943</id>
		<title>Translations:Setup Fcitx 5/Page display title/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Setup_Fcitx_5/Page_display_title/zh-cn&amp;diff=45943"/>
		<updated>2023-12-07T03:37:58Z</updated>

		<summary type="html">&lt;p&gt;Winson: Created page with &amp;quot;设置 Fcitx 5&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;设置 Fcitx 5&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Setup_Fcitx_5&amp;diff=45899</id>
		<title>Setup Fcitx 5</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Setup_Fcitx_5&amp;diff=45899"/>
		<updated>2023-12-07T03:35:02Z</updated>

		<summary type="html">&lt;p&gt;Winson: Marked this version for translation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
= Autostart = &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Distribution specific tool == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
Distribution may provides some specific tool for autostart Fcitx and usually also set up environment variable together.&lt;br /&gt;
&lt;br /&gt;
=== im-config (Debian/Debian-based/Ubuntu) === &amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
This is a tool used by debian or debian based distribution. Just run &amp;lt;code&amp;gt;im-config&amp;lt;/code&amp;gt; from command line after login to your graphics interface and it should pop up a wizard, just select fcitx5 from it.&lt;br /&gt;
&lt;br /&gt;
=== imsettings (Fedora) === &amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
A program that is similar to im-config, and it also provides a GUI to select the input method framework to be used. Under default installation, imsettings should be installed by default, if not, you may install that. imsettings can setup the environment variable and also launch the input method correspondingly. It also provides a graphical frontend [https://pkgs.org/search/?q=im-chooser im-chooser] to change the configuration. What you need to do is simply execute &amp;lt;code&amp;gt;im-chooser&amp;lt;/code&amp;gt;, log-out and log-in again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
[https://www.youtube.com/watch?v=FwqTtGEN4vQ Video instruction for Fedora 36 KDE]. This instruction should work for other non-GNOME XDG-compliance desktop.&lt;br /&gt;
&lt;br /&gt;
=== fcitx5-autostart (Fedora) === &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
This is a [https://pkgs.org/search/?q=fcitx5-autostart fedora package] that bundles a /etc/profile.d script for setting up environment variables and also XDG autostart file for autostart.&lt;br /&gt;
&lt;br /&gt;
== XDG Autostart == &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
Certain distribution may not provide such a file. If not, you can simply copy &amp;lt;code&amp;gt;/usr/share/applications/org.fcitx.Fcitx5.desktop&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;~/.config/autostart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;mkdir -p ~/.config/autostart &amp;amp;&amp;amp; cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== KWin Wayland 5.24+ == &amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
You do not have to do this if you use only Gtk/Qt/Xwayland application. If you want to use wayland native applications supporting text-input-v3, you will need to let KWin start input method as a special client.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
Simply open systemsettings, go to the &amp;quot;Virtual Keyboard&amp;quot; section, change the input method from &amp;quot;None&amp;quot; to &amp;quot;Fcitx 5&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Non-XDG compliant Window Manager/Wayland Compoistor == &amp;lt;!--T:13--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:14--&amp;gt;&lt;br /&gt;
In those case may not support XDG Autostart, please check your Window Manager manual about how to automatically launch a program upon start.&lt;br /&gt;
&lt;br /&gt;
=== Weston === &amp;lt;!--T:15--&amp;gt;&lt;br /&gt;
Weston is a reference wayland compositor implementation, which is not a common setup for normal user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:16--&amp;gt;&lt;br /&gt;
If you want to use the westons zwp_input_method_v1 implementation, you will need to have following content in your ~/.config/weston.ini (Update the path accordingly for if it is not /usr/bin/fcitx5).&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!--T:17--&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[input-method]&lt;br /&gt;
path=/usr/bin/fcitx5&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:18--&amp;gt;&lt;br /&gt;
There are certain issues if you try to use weston in a nested mode for debugging and fcitx5, if you already have a running fcitx5 in the same session.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:19--&amp;gt;&lt;br /&gt;
If you just run weston under X11 for debugging purpose, easiest way is to simply quit fcitx5 before start weston.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:20--&amp;gt;&lt;br /&gt;
Also be aware, there is a bug that weston does not set DISPLAY correctly input method on the first run. You may need to kill fcitx5 once to make it get the right DISPLAY or use OpenX11Connection dbus call to let fcitx to connect.&lt;br /&gt;
&lt;br /&gt;
= Environment variables = &amp;lt;!--T:21--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:22--&amp;gt;&lt;br /&gt;
Due to the transition phase in a lot of different places, there is no perfect solution that works for every one. Please choose your own solution based on your environment. Basically what you want to do is to set following environment variables for your desktop session. &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Though it looks like valid shell script, please *NOTE* that the snippet above is just to demonstrate what these value gonna be. Please check the section below for concrete syntax for different methods.&lt;br /&gt;
&lt;br /&gt;
== Login shell profile == &amp;lt;!--T:23--&amp;gt;&lt;br /&gt;
If you are using Bash as your login shell, &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; is the best user-level thing you can rely on. It is widely supported by different DMs and will also work if you start graphics from TTY.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:24--&amp;gt;&lt;br /&gt;
* Supported by mainstream Display manager, including GDM/SDDM/LightDM&lt;br /&gt;
* TTY login&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:25--&amp;gt;&lt;br /&gt;
If you are not using bash, you may want to double check if your shell profile can be used as a place to set environment variables, especially you are using some uncommon login shells. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:26--&amp;gt;&lt;br /&gt;
The snippet that you need to add to &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; would be&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
export XMODIFIERS=@im=fcitx&lt;br /&gt;
export GTK_IM_MODULE=fcitx&lt;br /&gt;
export QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:27--&amp;gt;&lt;br /&gt;
Some may argue that &amp;lt;code&amp;gt;~/.profile&amp;lt;/code&amp;gt; is a shell agnostic solution, which is wrong. While GDM always source this file, SDDM/Bash would not source this file if &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; presents. This makes &amp;lt;code&amp;gt;~/.bash_profile&amp;lt;/code&amp;gt; a better solution because bash is quite widely used. But check your login shell before proceeding, some distribution may not use bash as default shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:28--&amp;gt;&lt;br /&gt;
Here is an [https://youtu.be/8XDmLr6wb4M video] on how to manual setup environment variable on Archlinux&lt;br /&gt;
&lt;br /&gt;
== /etc/profile == &amp;lt;!--T:29--&amp;gt;&lt;br /&gt;
Best option if you does not care about modifying a file with root. This file is generally supported by all distribution. The code snippet that you need to append to the end of &amp;lt;code&amp;gt;/etc/profile&amp;lt;/code&amp;gt; is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== ~/.xprofile == &amp;lt;!--T:30--&amp;gt;&lt;br /&gt;
An old perfect option if you are using X11 and display manager. But there is no counterpart for Wayland, so it is not ideal if you want to set environment variable for Wayland. The code that you want to add is same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== environment.d == &amp;lt;!--T:31--&amp;gt;&lt;br /&gt;
This is a new configuration that introduced by system.d, but not widely used supported by desktop environment or display manager. It is basically the environment configuration for systemd user unit. Currently, it is only supported by GDM or Plasma 5.22+. As GDM, it means any session that login with GDM will work. As for Plasma, it means it works for Plasma regardless what DM you are using.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:32--&amp;gt;&lt;br /&gt;
This configuration is applied upon your first user session login and persist afterwards unless you manually stop the systemd user. So after you modifies this configuration, the easiest way to make it effective is to reboot your system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:33--&amp;gt;&lt;br /&gt;
The syntax is similar to shell, but no &amp;lt;code&amp;gt;export&amp;lt;/code&amp;gt; is required. For example, you can create a file &amp;lt;code&amp;gt;~/.config/environment.d/im.conf&amp;lt;/code&amp;gt; with following content:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
XMODIFIERS=@im=fcitx&lt;br /&gt;
GTK_IM_MODULE=fcitx&lt;br /&gt;
QT_IM_MODULE=fcitx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pam_env.so == &amp;lt;!--T:34--&amp;gt;&lt;br /&gt;
This is an obsolete solution for following reasons:&lt;br /&gt;
* pam deprecate user level configuration &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt; since 1.5.0.&lt;br /&gt;
* Some distribution does not enable pam_env in their pam configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:35--&amp;gt;&lt;br /&gt;
If you know it works for your system, you can put following snippet to your &amp;lt;code&amp;gt;~/.pam_environment&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;XMODIFIERS DEFAULT=\@im=fcitx&lt;br /&gt;
GTK_IM_MODULE DEFAULT=fcitx&lt;br /&gt;
QT_IM_MODULE DEFAULT=fcitx&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:36--&amp;gt;&lt;br /&gt;
Please &#039;&#039;&#039;NOTE&#039;&#039;&#039; that the syntax is different from shell script.&lt;br /&gt;
&lt;br /&gt;
== ~/.config/plasma-workspace/env/*.sh == &amp;lt;!--T:37--&amp;gt;&lt;br /&gt;
A env script location that only works for Plasma desktop, you need to create your own .sh file, e.g. &amp;lt;code&amp;gt;~/.config/plasma-workspace/env/im.sh&amp;lt;/code&amp;gt; and put the code snippet same as [[Special:myLanguage/Setup Fcitx 5#Login in shell profile|login shell]].&lt;br /&gt;
&lt;br /&gt;
== Other less common setup == &amp;lt;!--T:38--&amp;gt;&lt;br /&gt;
There are some other variable that might be useful certain applications.&lt;br /&gt;
=== SDL_IM_MODULE ===&lt;br /&gt;
Set the value to fcitx. Only SDL2 requires this. SDL1 uses XIM.&lt;br /&gt;
=== GLFW_IM_MODULE ===&lt;br /&gt;
This is a variable only used by [https://github.com/kovidgoyal/kitty/ kitty]. You need to set it to `GLFW_IM_MODULE=ibus`.&lt;br /&gt;
=== Binary Qt application ===&lt;br /&gt;
Due to Qt 5 does not support XIM, and it only bundles ibus im module, you may want to set `QT_IM_MODULE=ibus` for Qt application that does not use your system Qt library. (It may still not work because certain Qt application does not even bundle any im module). &lt;br /&gt;
&lt;br /&gt;
= DBus = &amp;lt;!--T:39--&amp;gt;&lt;br /&gt;
On most distribution that ships with systemd, this should no longer be an issue. But if you are using some so called &amp;quot;systemd&amp;quot; free distribution, you may need to start DBus yourself and set the relevant environment variables. Usually, this can be done by adding a line in like this in your start up script. E.g. ~/.xprofile if you are using X11. Also you need to make sure this syntax works for your login shell. &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;eval `dbus-launch --sh-syntax --exit-with-session`&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configure Fcitx 5 = &amp;lt;!--T:40--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:41--&amp;gt;&lt;br /&gt;
See [[Special:myLanguage/Configtool (Fcitx 5)|Configtool (Fcitx 5)]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Fcitx_5/zh-cn&amp;diff=45898</id>
		<title>Fcitx 5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Fcitx_5/zh-cn&amp;diff=45898"/>
		<updated>2023-12-07T03:29:57Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
小企鹅输入法（Fcitx 读作[ˈfaɪtɪks]）是一个支持扩展的输入法框架。目前，它支持Linux操作系统，以及如freebsd这样的Unix操作系统。Fcitx 通过使用各种各样的输入法引擎来支持全世界大量不同种类的语言。&lt;br /&gt;
&lt;br /&gt;
Fcitx本身的核心实现非常简单，它通过使用插件来提供强大的功能。fcitx可以非常容易的进行定制以满足不同的个性化需求。&lt;br /&gt;
&lt;br /&gt;
[[Special:myLanguage/Fcitx|导航至旧版的 Fcitx 4 Wiki页面?]]&lt;br /&gt;
&lt;br /&gt;
==== 用户 ====&lt;br /&gt;
&lt;br /&gt;
* [[Special:myLanguage/Install Fcitx 5|如何安装 Fcitx 5]]&lt;br /&gt;
* [[Special:myLanguage/Setup Fcitx 5|设置 Fcitx 5]]&lt;br /&gt;
* 安装 [[Special:myLanguage/Input method engines|输入法引擎]]&lt;br /&gt;
* [[Special:myLanguage/Theme Customization|定制您的输入法主题]]&lt;br /&gt;
* [[Special:myLanguage/FAQ|常见问题]]&lt;br /&gt;
* [[Special:myLanguage/Using Fcitx 5 on Wayland|在 Wayland 上使用 Fcitx 5]]&lt;br /&gt;
&lt;br /&gt;
==== 开发者 ====&lt;br /&gt;
&lt;br /&gt;
* [[Special:myLanguage/Compiling fcitx5|如何编译 fcitx5]]&lt;br /&gt;
* [[Special:myLanguage/Basic concept|基本概念]]&lt;br /&gt;
* [[Special:myLanguage/Develop an simple input method|如何开发一个简单的输入法]]&lt;br /&gt;
* [[Special:myLanguage/Q&amp;amp;A for developer|开发者常见问题与解答]]&lt;br /&gt;
* [[Special:myLanguage/Debug fcitx5|调试 fcitx5]]&lt;br /&gt;
&lt;br /&gt;
==== 新闻 ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;rss max=5&amp;gt;https://politepol.com/fd/hhM5BOjZLblk&amp;lt;/rss&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 如何帮助 Fcitx ==&lt;br /&gt;
* 给你的朋友推荐Fcitx输入法&lt;br /&gt;
* [[Special:myLanguage/Report Bug|报告漏洞]]&lt;br /&gt;
* [[Special:myLanguage/Contribute to this Wiki|为Wiki做贡献]] (&#039;&#039;&#039;请在申请你的帐号之前仔细阅读此页面&#039;&#039;&#039;)&lt;br /&gt;
* [[Special:myLanguage/Donate|捐助]]&lt;br /&gt;
&lt;br /&gt;
== 关于 ==&lt;br /&gt;
* [[Special:myLanguage/History|Fcitx的历史]]&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
	<entry>
		<id>https://fcitx-im.org/index.php?title=Translations:Fcitx_5/5/zh-cn&amp;diff=45897</id>
		<title>Translations:Fcitx 5/5/zh-cn</title>
		<link rel="alternate" type="text/html" href="https://fcitx-im.org/index.php?title=Translations:Fcitx_5/5/zh-cn&amp;diff=45897"/>
		<updated>2023-12-07T03:29:57Z</updated>

		<summary type="html">&lt;p&gt;Winson: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Special:myLanguage/Install Fcitx 5|如何安装 Fcitx 5]]&lt;br /&gt;
* [[Special:myLanguage/Setup Fcitx 5|设置 Fcitx 5]]&lt;br /&gt;
* 安装 [[Special:myLanguage/Input method engines|输入法引擎]]&lt;br /&gt;
* [[Special:myLanguage/Theme Customization|定制您的输入法主题]]&lt;br /&gt;
* [[Special:myLanguage/FAQ|常见问题]]&lt;br /&gt;
* [[Special:myLanguage/Using Fcitx 5 on Wayland|在 Wayland 上使用 Fcitx 5]]&lt;/div&gt;</summary>
		<author><name>Winson</name></author>
	</entry>
</feed>