Difference between revisions of "Configure (Other)"

From Fcitx
Jump to navigation Jump to search
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages />
+
<languages/>
 
<translate>
 
<translate>
 
== Setup environment variables == <!--T:1-->
 
== Setup environment variables == <!--T:1-->
 
In spite of Ubuntu, Debian, Fedora, OpenSUSE, other distribution don't have utils to help to setup required environment variable.
 
In spite of Ubuntu, Debian, Fedora, OpenSUSE, other distribution don't have utils to help to setup required environment variable.
  
 +
<!--T:17-->
 
{{warning|Notice! Setting environment variable is hard for normal user to understand what are they for, and may conflicts with normal settings with distribution built-in tool.}}
 
{{warning|Notice! Setting environment variable is hard for normal user to understand what are they for, and may conflicts with normal settings with distribution built-in tool.}}
  
 +
<!--T:18-->
 
To explain it as easy as possible how this works. That is, if you are using a graphical GUI to type user name, or to login, you will need to add
 
To explain it as easy as possible how this works. That is, if you are using a graphical GUI to type user name, or to login, you will need to add
  
 +
<!--T:19-->
 
  export GTK_IM_MODULE=fcitx
 
  export GTK_IM_MODULE=fcitx
 
  export QT_IM_MODULE=fcitx
 
  export QT_IM_MODULE=fcitx
 
  export XMODIFIERS=@im=fcitx
 
  export XMODIFIERS=@im=fcitx
  
to ~/.xprofile (It will be a hidden file, since the file name starts with dot), open your favorite editor, gedit, kwrite, vim, emacs to edit it).
+
<!--T:20-->
 +
to ~/.xprofile (X11), ~/.bash_profile (bash shell), or ~/.profile (under certain case it won't be read if .bash_profile presents). It will be a hidden file, since the file name starts with dot. You may use any editor, like gedit, kwrite, vim, emacs to edit it.
  
 +
<!--T:21-->
 
And make sure, if you open any gtk application, and right click on an input field, there is an item for fcitx in Input Method Menu, like
 
And make sure, if you open any gtk application, and right click on an input field, there is an item for fcitx in Input Method Menu, like
  
 +
<!--T:22-->
 
[[File:GtkInputMethodMenu.png]]
 
[[File:GtkInputMethodMenu.png]]
  
 +
<!--T:23-->
 
And make sure if you open any qt application, and right click on an input field, there is also an item named in input method menu, like
 
And make sure if you open any qt application, and right click on an input field, there is also an item named in input method menu, like
  
 +
<!--T:24-->
 
[[File:QtInputMethod.png]]
 
[[File:QtInputMethod.png]]
  
 +
<!--T:25-->
 
It doesn't have to be selected if you haven't logout and re-login to make your setting effects, but you need to make sure they are selected after you change the setting and re-login.
 
It doesn't have to be selected if you haven't logout and re-login to make your setting effects, but you need to make sure they are selected after you change the setting and re-login.
  
=== Advance ===
+
=== Advance === <!--T:26-->
 
If you can complete the step above, you don't need to bother following description.
 
If you can complete the step above, you don't need to bother following description.
  
Line 40: Line 49:
 
  export QT_IM_MODULE=fcitx # or xim
 
  export QT_IM_MODULE=fcitx # or xim
 
  export XMODIFIERS=@im=fcitx
 
  export XMODIFIERS=@im=fcitx
 
=== Use GDM/KDM/LightDM/Slim (Session Mode) === <!--T:6-->
 
~/.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).
 
  
 
=== Use Slim (~/.xinitrc)/startx === <!--T:7-->
 
=== Use Slim (~/.xinitrc)/startx === <!--T:7-->
Line 52: Line 58:
 
<!--T:9-->
 
<!--T:9-->
 
At the head, to make sure DBus correctly initialized.
 
At the head, to make sure DBus correctly initialized.
 +
 +
<!--T:27-->
 +
With newer slim, you may need this instead:
 +
 +
<!--T:28-->
 +
dbus-launch --sh-syntax --exit-with-session > /dev/null
  
 
=== Other environment === <!--T:10-->
 
=== Other environment === <!--T:10-->

Latest revision as of 16:45, 23 November 2020

Other languages:
English • ‎中文(简体)‎

Setup environment variables

In spite of Ubuntu, Debian, Fedora, OpenSUSE, other distribution don't have utils to help to setup required environment variable.

Warning: Notice! Setting environment variable is hard for normal user to understand what are they for, and may conflicts with normal settings with distribution built-in tool.



To explain it as easy as possible how this works. That is, if you are using a graphical GUI to type user name, or to login, you will need to add

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

to ~/.xprofile (X11), ~/.bash_profile (bash shell), or ~/.profile (under certain case it won't be read if .bash_profile presents). It will be a hidden file, since the file name starts with dot. You may use any editor, like gedit, kwrite, vim, emacs to edit it.

And make sure, if you open any gtk application, and right click on an input field, there is an item for fcitx in Input Method Menu, like

GtkInputMethodMenu.png

And make sure if you open any qt application, and right click on an input field, there is also an item named in input method menu, like

QtInputMethod.png

It doesn't have to be selected if you haven't logout and re-login to make your setting effects, but you need to make sure they are selected after you change the setting and re-login.

Advance

If you can complete the step above, you don't need to bother following description.

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.

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 QT_IM_MODULE=fcitx # or xim
export XMODIFIERS=@im=fcitx

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`

At the head, to make sure DBus correctly initialized.

With newer slim, you may need this instead:

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.

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.


If you running a XDG compatible desktop, for example, Gnome, KDE, LXDE, Xfce, you can run

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.

See also

Input method related environment variables