Plasma 6, Wayland, and iBus

Hi,

With X11 session this setup works fine (~/.xprofile):

...
if [ $XDG_SESSION_TYPE == 'x11' ]; then
    export GTK_IM_MODULE=ibus
    export QT_IM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    exec /usr/bin/ibus-daemon -rxRd &
fi

With Wayland session it still works. Why, BTW? I’ve never been starting ibus-daemon anywhere else. It works with a minor hitch, though: the keyboard layout change requires extra key press. Also key repeat seems to be broken.

Is there the recommended way to use Plasma 6, Wayland, and iBus?

No idea but maybe some of the wiki information might be helpful to you - IBus - ArchWiki

KDE comes with a plasmoid called Input Method Panel that can act as an IBus frontend and can possibly provide a better integrated experience.

I just have mine set to switch layouts by pressing SHIFT + CAPSLOCK. You might find it easier just to set this, or something similar?

Still can’t make it work. Now I have in the tray Input Method icon which won’t react on Left Click; on Right Click it guides me to Virtual Keyboard - System Settings. There I have IBus Wayland already selected, but otherwise it’s as good as dead.

I can start IBus daemon manually;

$  ibus-daemon -rxRd &

It still won’t work as expected.

Google Search brings me back to this very theme, mostly :frowning:

ibus should’ve send you a notification about how to set it up/ solve problems on wayland every time you start/restart it. Basically it told me to do:

  1. select “ibus” on virtual keyboard settings
  2. unset variables in /etc/environment related to ibus


image

(remember to remove the autostart entry for ibus if any, they are not needed on wayland)

And re-login, everything works.

/etc/environment:

#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#

It looks like I’ve taken into account everything you mention. It works. Well, almost. My problems are discussed around, but the talk is vague and inconclusive, unfortunately.

  1. It requires an extra key press to actually change the layout. Not always, but more often than not.
  2. No auto repeat. Not always, but more often than not.

It’s still a showstopper, considering the ubiquity and importance of the keyboard.

UPD

My preferred Next Input Method shortcut is <Shift>space.

Could you elaborate on this? Capslock isn’t on the list :blush: .

You mean as in this screenshot?


(See e.g. the box where my mouse pointer is).

EDIT:
If you click that button, the option should be one up from the bottom of the list which appears?

No. As in this:

It’s been an IBus question all along.

Right, sorry for the confusion. :wink:

Nobody knows, then. It occurred to me that Gnome 3.6 and later uses IBus by default. So it’s extremely unlikely that it works there just like in my case. Even under Wayland. Any idea where to start the research?

Update:

~> plasmashell --version
plasmashell 6.1.5
~>

The IBus behavior under Wayland changed. Now in console (Alacritty) the keyboard layout switch works as expected. Still, no autorepeat. With Google Chrome, the keyboard layout switch won’t work, but autorepeat works. With Geany, it works just as before: switch usually with an extra key press, autorepeat works sometimes, mostly it does not.

The developers probably are aware of the trouble; they probably do something; nobody’s in the know, somehow.