Linux FAQ's & Manuals


customizing xim server startup


this section explains which scripts are used to startup an xim server automatically to enable you to edit these scripts if you have special requirements and need to customize the automatic xim server startup.

on suse linux < = 8.2, the starting of the xim server is done by the script ~/.xim, which is sourced by ~/.xinitrc or ~/.xsession. you can find the default suse versions of these scripts in /etc/skel. during the creation of a new user with yast2, the files from /etc/skel will automatically be copied to the users home directory thus, a newly created user will automatically have these files. note that the user root is an exception, root will not have these files by default. actually, root will get very few dot-files by default. if you are missing these files for whatever reason, you can copy the default versions from /etc/skel to your home directory.

on suse linux > 8.2, ~/.xim and ~/.xinitrc will still be used if they exist but if not the system wide file default files /etc/x11/xim and /etc/x11/xinit/xinitrc will be used. therefore an xim server should start automatically even for the root user without the need to copy any dot-files from /etc/skel to root. on suse linux > 8.2 you only need to create a ~/.xim file if you don't like the system defaults. you can start by copying /etc/x11/xim or ~/.xim.template to ~/.xim and adapt to your needs.

basically, the script ~/.xim checks the lc_ctype locale and tries to start the ``best''available xim server for this locale.

you may not like the system defaults because

as an example, let's assume you usually start your x11 session in english, because you mostly use english and prefer that your window manager or desktop environment shows english menus, but nevertheless you always want to have the japanese input server kinput2 and the korean input server ami running and want to set the xmodifiers and lc_ctype environment variables to use kinput2 by default. then you can set the default values write something like the following example into your ~/.xim:

     # start japanese input server kinput2 with canna backend:     /usr/x11r6/bin/kinput2 -xim -kinput -canna &      # start korean input server ami:     /opt/gnome/bin/ami &      # set xmodifiers to use kinput2 by default     export xmodifiers="@im=kinput2" 

assuming that you have set the default values for the language specific environment variables like this

     rc_lang="en_gb.utf-8"     rc_lc_all=""     rc_lc_messages=""     rc_lc_ctype="ja_jp.utf-8"     rc_lc_collate=""     rc_lc_time=""     rc_lc_numeric=""     rc_lc_monetary=""     root_uses_lang="yes" 

in /etc/sysconfig/language (or do something with the same effect in your personal profiles), kinput2 will be used by default xim server because the value of lc_ctype is a japanese locale and xmodifiers points to kinput2.

very few programs are capable of switching xim servers on the fly, currently only the terminal ``mlterm'' and the text editor ``yudit'' can do this. in these programs you can switch on the fly between using kinput2 and ami when both are running.

most programs can only use one xim server at a time and decide which one to use according to the values of lc_ctype and xmodifiers when they start.

the setup in the above example has lc_ctype set to a japanese locale and xmodifiers pointing to kinput2, i.e. to make a program use ami you have to start it like

     lc_ctype=ko_kr.utf-8 xmodifiers=@im=ami <program> 

otherwise it will use kinput2.


in the following sections, the available xim servers are explained in greater detail.

2005-03-09