Configure (Other)/zh-hans: Difference between revisions

From Fcitx
Jump to navigation Jump to search
Created page with "=== 进阶 === 如果你能完成以上步骤,你不需要在意下面的内容。"
FuzzyBot (talk | contribs)
Updating to match new version of source page
 
(22 intermediate revisions by 3 users not shown)
Line 11: Line 11:
  export XMODIFIERS=@im=fcitx
  export XMODIFIERS=@im=fcitx


到你的 ~/.xprofile (这是一个隐藏文件,因为文件名由“点”开头),用你最喜欢的编辑器打开编辑它,例如gedit,kwrite,vim,emacs。
到你的 ~/.xprofile (X11),~/.bash_profile (bash shell),或者 ~/.profile (在一些情况下如果 bash_profile 存在它将不会被读取)。这是一个隐藏文件,因为文件名由“点”开头。您可以用任意编辑器打开编辑它,例如gedit,kwrite,vim,emacs。


并且确认,当你打开任意gtk程序的时候,在一个输入框点击鼠标右键,在输入法菜单中有一个fcitx的项目,例如
并且确认,当你打开任意gtk程序的时候,在一个输入框点击鼠标右键,在输入法菜单中有一个fcitx的项目,例如
Line 26: Line 26:
如果你能完成以上步骤,你不需要在意下面的内容。
如果你能完成以上步骤,你不需要在意下面的内容。


Fcitx can use XIM or Fcitx's own DBus protocol to communicate with input program. Since 4.1, Fcitx provides GTK2/3 and Qt4 input method module, in order to provides better experience in those application, it's highly recommended to use im module instead of XIM, in order to avoid unresolvable problem.
fcitx能使用XIM或者其自带的DBus模块与输入程序通信。为了在GTK2/3和Qt程序中提供更好的体验,fcitx从4.1开始包含GTK和Qt的原生输入法模块。强烈推荐使用原生的输入法模块来代替XIM,因为这样能避免无法解决的问题。


There are several places to setup environment variable. It depends on how you start up your Display Server.
有很多设置环境变量的地方。这取决于您如何启动您的图形化显示服务器。


Requires following lines.
需要以下内容。


  export GTK_IM_MODULE=fcitx # or xim
  export GTK_IM_MODULE=fcitx # or xim
Line 36: Line 36:
  export XMODIFIERS=@im=fcitx
  export XMODIFIERS=@im=fcitx


=== Use GDM/KDM/LightDM/Slim (Session Mode) ===
=== 使用Slim(~/.xinitrc)/startx ===
~/.xprofile is the best choice (If not exists, create a new one), since it will only affect X and will not pollute to other console environment. Some other people might like to use ~/.profile (Affect whenever you login), or /etc/profile (Global profile).
在这种情况下,您启动时会使用 ~/.xinitrc ,您也需要将上面那些内容放入~/.xinitrc。由于您需要使用DBus(输入法模块和kimpanel需要),您也许想要添加下面的:
 
=== Use Slim (~/.xinitrc)/startx ===
In that case, you are using ~/.xinitrc to startup, you also need those lines in your ~/.xinitrc. And depends on you use DBus (im module and kimpanel need it), you might want to add


  eval `dbus-launch --sh-syntax --exit-with-session`
  eval `dbus-launch --sh-syntax --exit-with-session`


At the head, to make sure DBus correctly initialized.
要先确保DBus正确初始化了。


With newer slim, you may need this instead:
使用较新的 slim 时,你也许需要加入:


  dbus-launch --sh-syntax --exit-with-session > /dev/null
  dbus-launch --sh-syntax --exit-with-session > /dev/null


=== Other environment ===
=== 其他环境 ===
Maybe you are using vncserver, or something else, you need to figure out your start script, for example, vncserver use ~/.vnc/xstartup. Treat it similar with ~/.xinitrc.
也许您在用vncserver或者其他什么的,您需要找出您的启动脚本,比如 vncserver用的是~/.vnc/xstartup。用~/.xinitrc一样的配置来配置它。


== Autostart ==
== 自动启动 ==
For ~/.xinitrc, you can put fcitx to your ~/.xinitrc. Fcitx will run as daemon by default, so no need to use fcitx & to start it.
对于 ~/.xinitrc,您可以将fcitx写入您的 ~/.xinitrc。fcitx会自动作为后台进程运行,所以不需要用fcitx & 来启动。




If you running a [http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG] compatible desktop, for example, Gnome, KDE, LXDE, Xfce, you can run
如果您在用[http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG]兼容桌面,比如Gnome,KDE,LXDE,Xfce,您可以运行


  cp /usr/share/applications/fcitx.desktop ~/.config/autostart/fcitx.desktop
  cp /usr/share/applications/fcitx.desktop ~/.config/autostart/fcitx.desktop


To add fcitx to your autostart. You can also use tool provided by your desktop to do the same thing.
来使fcitx自动启动。您也可以用您桌面环境提供的工具来自动启动fcitx。


== See also ==
== 参见 ==
[[Special:myLanguage/Input method related environment variables|Input method related environment variables]]
[[Special:myLanguage/Input method related environment variables|输入法相关环境变量]]


[[Category:How-to]]
[[Category:How-to]]

Latest revision as of 16:48, 23 November 2020

配置环境变量

除了Ubuntu、Debian、Fedora、OpenSUSE外的其他发行版没有可以配置fcitx所需环境变量的工具。

Warning: 注意! 设置环境变量对一般用户来说是很难理解的,并可能会和发行版内置的工具冲突。



如果要尽量简单的说明怎样设置的话,如果你在使用一个图形化的界面来进行用户名的输入并登录,你需要添加

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

到你的 ~/.xprofile (X11),~/.bash_profile (bash shell),或者 ~/.profile (在一些情况下如果 bash_profile 存在它将不会被读取)。这是一个隐藏文件,因为文件名由“点”开头。您可以用任意编辑器打开编辑它,例如gedit,kwrite,vim,emacs。

并且确认,当你打开任意gtk程序的时候,在一个输入框点击鼠标右键,在输入法菜单中有一个fcitx的项目,例如

并且确认当你打开任意qt程序时,右键点击任意输入框,将有一项fcitx在输入法菜单中,例如

如果你还未注销并重新登录,那么这项并不需要被选中,但你重新登录之后请确认这项被默认选中。

进阶

如果你能完成以上步骤,你不需要在意下面的内容。

fcitx能使用XIM或者其自带的DBus模块与输入程序通信。为了在GTK2/3和Qt程序中提供更好的体验,fcitx从4.1开始包含GTK和Qt的原生输入法模块。强烈推荐使用原生的输入法模块来代替XIM,因为这样能避免无法解决的问题。

有很多设置环境变量的地方。这取决于您如何启动您的图形化显示服务器。

需要以下内容。

export GTK_IM_MODULE=fcitx # or xim
export QT_IM_MODULE=fcitx # or xim
export XMODIFIERS=@im=fcitx

使用Slim(~/.xinitrc)/startx

在这种情况下,您启动时会使用 ~/.xinitrc ,您也需要将上面那些内容放入~/.xinitrc。由于您需要使用DBus(输入法模块和kimpanel需要),您也许想要添加下面的:

eval `dbus-launch --sh-syntax --exit-with-session`

要先确保DBus正确初始化了。

使用较新的 slim 时,你也许需要加入:

dbus-launch --sh-syntax --exit-with-session > /dev/null

其他环境

也许您在用vncserver或者其他什么的,您需要找出您的启动脚本,比如 vncserver用的是~/.vnc/xstartup。用~/.xinitrc一样的配置来配置它。

自动启动

对于 ~/.xinitrc,您可以将fcitx写入您的 ~/.xinitrc。fcitx会自动作为后台进程运行,所以不需要用fcitx & 来启动。


如果您在用XDG兼容桌面,比如Gnome,KDE,LXDE,Xfce,您可以运行

cp /usr/share/applications/fcitx.desktop ~/.config/autostart/fcitx.desktop

来使fcitx自动启动。您也可以用您桌面环境提供的工具来自动启动fcitx。

参见

输入法相关环境变量