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
Important Notes:
- If
~/.xinputrcis present, it’s automatically used byim-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
No issues found.