IBus and Qt Applications

A recent post by @jonathon introduced me to IBus, a input method mainly for Asian writing systems, but also for emojis and other Unicode characters. It seems nice enough to explore it in more detail.

I followed the Arch Wiki, which involved three steps:

  1. installing the ibus package with pacman:
  2. setting the following environment variables:
    GTK_IM_MODULE=ibus
    QT_IM_MODULE=ibus
    XMODIFIERS=@im=ibus
    
  3. running the ibus-daemon, either alone:
    ibus-daemon -drxR
    
    or with a KDE Input Method Panel as frontend:
    ibus-daemon -drxR --panel=/usr/lib/kimpanel-ibus-panel
    

On KDE Plasma the above steps somewhat work, apart from few minor issues: e.g. the switching between keyboard layouts using the shortcut Meta+  Space   is broken (it displays the list of keyboard layouts, but switching between them does nothing), and other little things like that…

However, my main issue is with emoji input (which is the main reason I am exploring this program). The input method is this: press the keyboard shortcut Ctrl+Shift+E, type the name of the emoji, press   Space   to preview the emoji and then Enter  .

This works fine in many applications (like Firefox, for example this frog: :frog:, Alacrity, LibreOffice Writer…), except it does nothing in Qt applications, the keyboard shortcut is not registered at all.

As it happens, the two programs (Konsole and Kate) I would like to use this in the most are both Qt applications…

After fiddling with it the whole night, I am now quite exhausted. Does anyone have any experience using IBus on KDE?

@zangoku have some ibus experience as far as i remember, maybe he’ll help :upside_down_face:

This kind of sounds like something else is overriding QT_IM_MODULE. :thinking:

Doesn’t look like it is:

~🐸 echo $QT_IM_MODULE
ibus
1 Like

I use fcitx for asian input instead of ibus. You could always try to give fcitx a shotx but I am not sure how it works for emojis.

The other idea I have is that there’s another keyboard shortcut that’s grabbing CTRL+ALT+E… I don’t use KDE though. :pensive:

I’ve had a bit more time to look into it and I noticed that when I start the daemon from the interactive shell session in Konsole, I have to close Konsole. When I reopen it, the keyboard shortcut works in it.

If I start the daemon from a script in ~/.config/autostart-scripts that does nothing. :confused:

I’ll figure it out, now I know that it can work in Qt apps, that’s the only thing that matters.

3 Likes

Hey,

Sorry, to reopen an old thread but I am also having issues with ibus/fcitx wrt asian language inputs. I am having the same issues that you have but on xmonad :upside_down_face:. The ibus-daemon doesn’t start automatically despite writing a auto start file in ~/.config/

The content of my autostart file.

[Desktop Entry]
Exec=ibus-daemon -drx
Icon=system-run
StartupNotify=true
Terminal=false
Type=Application

Wondering if you found a more permanent solution?

I was able to install ibus but can’t run the last step which is ibus-setup. Something is wrong with my python (miniconda). Keeps giving me this error.

I did install the Gtk3 package required using conda. conda install -c conda-forge gtk3

Traceback (most recent call last):
  File "/usr/share/ibus/setup/main.py", line 38, in <module>
    gi_require_version('IBus', '1.0')
  File "/home/henri/miniconda3/lib/python3.9/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace IBus not available

switched to fcitx which solved the issue.

content of my /etc/environment file

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