Hi, polikuo. Mind me asking what you need ibus for? I used ibus for a decade (to input diacritics when typing in Portuguese and Esperanto) until a few years ago when I discovered that Xorg (via setxkbmap) had everything I needed already built-in.
https://wiki.gentoo.org/wiki/Keyboard_layout_switchingP.S. My keyboard is QWERTY, US layout. When I need to activate deadkeys (for Portuguese) and AltGr on CapsLock (for Esperanto) and CapsLock on the Escape key, I enter this command:
setxkbmap -layout us -variant intl -option lv3:caps_switch,esperanto:qwerty,caps:swapescape
The "-variant intl" part is what turns the keys with certain symbols (e.g., ~`^') into dead keys.
To go back to my keyboard's default behavior (no international deadkeys, no custom options), either a reboot or entering this command does the trick:
setxkbmap -layout us -option