iBus issue with Wayland


Clean Solution for IBus Configuration

Use a simple ~/.xinputrc file that detects the session type (X11 or Wayland) automatically.

# ~/.xinputrc

# Detect session type (Wayland or X11)
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
    # For Wayland (KDE, GNOME, etc.), no need to force GTK_IM_MODULE or QT_IM_MODULE
    export XMODIFIERS="@im=ibus"
else
    # For X11 (XFCE, MATE, LXDE, etc.), force compatibility
    export GTK_IM_MODULE=ibus
    export QT_IM_MODULE=ibus
    export XMODIFIERS="@im=ibus"
fi

:loudspeaker: Important Notes:

  • If ~/.xinputrc is present, it’s automatically used by im-config.
  • This overrides im-config’s automatic setup.
  • Works seamlessly across X11/Wayland without errors on KDE Plasma 6.

This approach ensures maximum compatibility without manual intervention.

Tested with:

  • IBus 1.5.32-rc2
  • KDE Plasma 6.3.4
  • Kali GNU/Linux Rolling 2025.1

:white_check_mark: No issues found.


2 Likes