Category:Internationalization <-- re-add category
This page explains how to set up uim for various languages.
If you use SCIM, see Smart Common Input Method platform.
If you use IBus, see Ibus.
- 1 Installation
- 2 Configuring uim
- 3 Troubleshooting
- 4 See also
Compiling uim from source using PKGBUILD
The UIM package in the official Arch repositories(as of 1.8.6) is built with the following options enabled:
--with-anthy-utf8- Enable Anthy(UTF-8) support
--with-qt4-immodule- Build Qt4 immodule
--with-qt4- Build uim-tools for Qt4
If you need uim compiled with custom options, you may want to build uim from source. Check the official UIM wiki for a list of all options that can be enabled at compile time. You may want to use the ABS to create a custom pkgbuild for uim. An example option you can add to uim with a custom pkgbuild is
--enable-kde4-applet, which gives you a KDE4 widget.
Depending on how you manage your X session, you need to follow different steps to configure uim. If you use
xinit, or a graphic Display Manager, see #Environment variables. If you use systemd to manage your X session, go to #Using systemd
export GTK_IM_MODULE='uim' export QT_IM_MODULE='uim' uim-xim & export XMODIFIERS='@im=uim'
If you want to use the UIM-toolbar which allows you to view, control, and switch the current input method, add one of the following to .xprofile, .xsession, or .xinitrc:
- For the GTK+ 2 toolbar:
- For the GTK+ 3 toolbar:
- For the QT4 toolbar:
This will enable the uim-toolbar as a floating panel. If you also want a systray icon, add one of the following instead.
- For GTK+ 2:
- For GTK+ 3:
xfce-xfapplet-pluginto use uim-applet-gnome.
If you are using systemd to manage your X session, you'll need to set the environment variables in your systemd session rather than an init script.
[Unit] Description=uim environment initialization Before=xorg.target [Service] Type=oneshot ExecStart=/usr/bin/systemctl --user set-environment XMODIFIERS=@im=uim ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE=uim ExecStart=/usr/bin/systemctl --user set-environment QT_IM_MODULE=uim
[Unit] Description=uim daemon Wants=uim-env.service After=xorg.target [Service] ExecStart=/usr/bin/uim-xim Restart=on-abort [Install] WantedBy=xorg.target
[Unit] Description=uim toolbar PartOf=uim.service [Service] ExecStart=/usr/bin/uim-toolbar-of-your-choice Restart=on-abort [Install] WantedBy=uim.service
Lastly, you'll need to enable the services:
$ systemctl --user enable uim.service uim-toolbar.service
Activate input methods
Open the uim preferences window by running :
$ uim-pref-gtk (Or, uim-pref-gtk3/uim-pref-qt4)
which opens a GUI.
Within "Global Settings", make sure that "Specify default IM" is checkmarked, then set your preferred input method as the default Input Method. You can also remove unused input methods from the list of enabled input methods.
- Vietnamese input methods, as well as Hán-Việt input methods, are available as VIQR and
- Chinese input methods are available as New Pinyin(simplified), Pinyin(Unicode), Pinyin(Traditional), and
You can run
uim-xim or restart X to test your settings.
Setting up hotkeys
Within "Global settings", you can set up a hotkey to switch between your IMEs. This is especially useful if you need to have type in several languages. Check the "Enable IM switching by Hotkey" checkbox, and set the IM switching key. By default, the Im switching hotkey is
You may also want to assign a hotkey to enable/disable your input method of choice. This allows you to quickly switch between your language and the raw keyboard input (often English) while typing. To do this, select the menu entry that says
your_IM key bindings 1 in the Tree menu on the left side of the preferences window. From there, you can set various hotkeys to control the functions of the input method.
Provided everything went well you should be able to input the chosen language in X.
Configuring uim for Emacs
uim provides a software bridge for Emacs called
uim.el. This section walks through setting up uim with Emacs using utf-8 encoding. Refer to the official uim wiki for more details.
Choosing how to call uim.el
There are two ways to call uim.el from Emacs: through the use of minor-mode or via LEIM(Library of Emacs Input Methods). Though the configuration is different for each, the basic functions are the same. If you need to switch between uim.el and other Emacs input methods frenquently, using the LEIM method is recommended.
If you want to use minor-mode to use uim.el, add the following to
.emacs.d/init.el, or other files that you use to customize Emacs.
;; read uim.el (require 'uim) ;; uncomment next and comment out previous to load uim.el on-demand ;; (autoload 'uim-mode "uim" nil t) ;; key-binding for activate uim (ex. C-\) (global-set-key "\C-\\" 'uim-mode)
If you wish to call uim.el through LEIM, add the following to
.emacs.d/init.el or other files you use to customize Emacs, and specify the default input method.
;; read uim.el with LEIM initializing (require 'uim-leim) ;; set default IM. Uncomment the one of the followings. ;(setq default-input-method "japanese-anthy-utf8-uim") ; Anthy (UTF-8) ;(setq default-input-method "japanese-google-cgiapi-jp-uim") ; Google-CGIAPI-Jp ;(setq default-input-method "japanese-mozc-uim") ; Mozc
Ignoring C-SPC on uim.el
When you are assigning activation/deactivation of input method to C-SPC, C-SPC is stolen to switch input mode by uim.el while it is activated. To prevent the stealing and use for set-mark-command, add the followings into your
.emacs.d/init.el or some other file for Emacs customizing.
(add-hook 'uim-load-hook '(lambda () (define-key uim-mode-map  nil) (define-key uim-mode-map  nil)))
Disabling XIM on Emacs
When you are using input method on your desktop and assigning activation/deactivation of input method to C-SPC, you will be not able to use C-SPC/C-@ as set-mark-command on Emacs. To avoid this problem, add the following into your
~/.Xdefaults. xim will be disabled on Emacs.
Set the GTK_IM_MODULE variable, but uim still not works with GTK+ 2 applications
In case you already set the GTK_IM_MODULE environmental variable, but uim still not works with GTK+ 2 applications, you need to specify the location of gtk.immodules, which is created by and can be generated with
The default location is
/etc/gtk-2.0/gtk.immodules for GTK+ 2.
You can do this with either the GTK_IM_MODULE_FILE variable (not recommended, it causes GTK+ 3 applications to see incompatible modules) or the im_module_file setting (recommended).
Add the following to
Cannot input Japanese on Opera
If you use Opera and cannot input Japanese with uim, try to edit environment variable as follows: Make sure to add follows in the beginning of /usr/bin/opera.
export XMODIFIERS='@im=uim' export QT_IM_MODULE='xim'
Cannot type a consonant in Zenkaku mode
If you cannot type a consonant in Zenkaku mode, add follows to your config file.
e.g. vi ~/.uim.d/customs/custom-google-cgiapi-jp.scm (define ja-rk-rule-hoge (map (lambda (c) (list (cons (list c) ()) (list c c c))) '("b" "c" "d" "f" "g" "h" "j" "k" "l" "m" "p" "q" "r" "s" "t" "v" "w" "x" "y" "z" "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z"))) (if (symbol-bound? 'ja-rk-rule-hoge) (set! ja-rk-rule (append ja-rk-rule-hoge ja-rk-rule)))
uim-toolbar-gtk-systray: tray icon is crushed
Though some of DE, WM or panel application may provide only one icon space per application on system-tray/notification-area, uim-toolbar-gtk-systray displays some icons on it by default so those icons are crushed. Choose just one of them to solve it. The steps to display only 'Input mode' icon for example as follows:
- Click 'Toolbar' on 'Group' list.
- Take the all checkmarks off.
- Click 'Anthy', 'Anthy (UTF-8)' or 'Mozc' which you are using on 'Group' list.
- Click Edit button in 'Toolbar' box > 'Enable toolbar buttons' line.
- Enable only 'Input mode' and click 'Close' button.
- Click 'OK' button to close uim-pref-gtk.
The tray icon will be displayed "あ" (Hiragana mode) or "ー" (Direct mode).
UIM toolbar icons are hard to see with a dark theme
You can choose icons for darker background (uim 1.6.0 or later).
- Run uim-perf-gtk
- Click 'Toolbar' on 'Group' list.
- Check 'Use icon for dark background'.