ibus tips

ibus provides “ibus” CLI utility.

ibus engine
Shows the current ibus engine. If a engine name is appended to this command, ibus switches to the engine. E.g. ibus engine anthy

ibus list-engine
Show registered engine names.

ibus version
Show ibus version number.

ibus exit
Exit ibus-daemon. You might start ibus with ibus-daemon --xim --verbose

ibus restart
Restart ibus-daemon.

ibus help
Show this information.

ibus read-cache
When ibus-daemon runs initially, ibus converts component files in /usr/share/ibus/component to a cache file and loads the cache file instead of the component files for the performance. The cache file is the system cache of /var/cache/ibus/bus/registry or the user cache of $HOME/.cache/ibus/bus/registry . ibus read-cache shows the user cache. ibus read-cache --system shows the system cache. You can notice more sub-commands with ibus read-cache --help

ibus write-cache
Write the user cache of $HOME/.cache/ibus/bus/registry . The user cache file is automatically generated if the system cache does not exist when ibus-daemon runs. You can generate the system cache of /var/cache/ibus/bus/registry with ibus write-cache --system with the root permission. Generally the system cache is generated with the package scripts during installations of ibus and ibus engine packages. You can notice more sub-commands with ibus write-cache --help

ibus read-config
Show the configuration values.

ibus reset-config
Reset the configuration values. This command resets the setting of the ibus core only but not ones of ibus engines. This command is useful to clean up the user configuration when you have a trouble. E.g. upgrade installation. You also can use gsettings command directly to set each value.

You may notice ibus-setup GUI cannot assign Shift+Ctrl to switch engines because both Shift and Ctrl is modifiers key. If you wish, you can assign it with gsettings command directly:

% gsettings get org.freedesktop.ibus.general.hotkey triggers
% gsettings set org.freedesktop.ibus.general.hotkey triggers ['<Shift>Control_L']

ibus shows the language prefix of the ibus XKB engine on ibus panel icon. The default color is a blue. You can customize the color with gsettings command.

% gsettings get org.freedesktop.ibus.panel xkb-icon-rgba 

The value format of xkb-icon-rgba is described in https://github.com/ibus/ibus/blob/master/data/ibus.schemas.in

ibus displays the engine switcher dialog with Super+space key. The default delay time is 400 milliseconds. If you switch two engines only and the dialog is not needed, you can set the value of switcher-delay-time to -1.

% gsettings get org.freedesktop.ibus.general switcher-delay-time

If your preferred XKB engine is not show on ibus-setup, you can add that engine in /usr/share/ibus/component/simple.xml by manual.

                        <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
                        <longname>English (Macintosh)</longname>
                        <description>English (Macintosh)</description>

About fujiwara

I'm an open-sourced desktop i18n developer.
This entry was posted in IBus and tagged , , , . Bookmark the permalink.

4 Responses to ibus tips

  1. JaimeTorres says:

    Hi, Thanks for this informative blog. You seem to know a lot about ibus and maybe you could help me figure out something. When does ibus “read” the contents of the various XKB keyboards included in simple.xml? How can I force this to happen later? I want to give the user the ability to modify the XKB sourcefile and then have ibus serve the updated version. Currently it does not do this. Once installed it saves a copy of the original version of the XKB and will use this even after the original has been modified. Where is this stored? Jaime

  2. fujiwara says:

    If simple.xml is has the latest time stamp than cache files, the cache files will be updated when ibus-daemon runs.
    ibus-daemon updates the user cache file under $HOME/.cache/ibus/bus/registry
    If you update cache files forcibly, you can run ‘ibus write-cache’ for the user cache or ‘ibus write-cache –system’ for the system cache and restart ibus-daemon.
    The system cache exists in /var/cache/ibus/bus/registry. The system cache is prioritized than the user caches.

  3. Zhao Qiang says:

    In Fedora and other Linux distributions, People should control iBUS engines in gnome-control-center.
    At the same time, ibus-setup setting can’t control the engines, pre-edit windows and other things.
    Could you please introduce why ?

    • fujiwara says:

      gnome-control-center is used for GNOME desktop and ibus-setpu is used for non-GNOME desktops so you cannot control engines and pre-edit windows by ibus-setup on GNOME.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s