How to operate ~/.XCompose with QT applications?

Dear all,

In order to have my ~/.XCompose configurations working not only in GTK applications, but also in QT one, I have tried with different input methods (xim, uim, fcitw) but it never works with QT applications. I can make it working with GTK applications: by now the better (and easiest) way that I have found is to write export GTK_IM_MODULE='xim'in ~/.xprofile. Adding export XMODIFIERS="@im=none to this file seems to change nothing, so I have removed this line. Adding export QT_IM_MODULE='xim' to this file does not make any change so I have left this line out too.

So what @bobbed wrote seems indeed to be still mysterious. I can also found different unanswered posts on ~/.XCompose on this forum (and I have read a lot of posts on different forums regarding it and QT) so it seems to be a tricky question.

Does anyone have an idea regarding XCompose and QT?

Thanks a lot for your help!

Have a nice day!

Hey there Killi,

I still don't know exactly how things operate, but many reinstalls and distro-hopping adventures later, here's how I got it to consistently work every time (I'll edit my original response now to reflect this):

(Of course, this assumes you have the .XCompose file saved in your home folder.

  1. install ibus (remove fctrx, uim or any other input framework. ibus is better because it shows the dead key symbols (like ') while I'm typing a combination, which really helps)
  2. Set the following environment variables:
GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XCOMPOSEFILE=$HOME/.XCompose
XMODIFIERS=@im=ibus
  1. reboot

In my experience, the most consistent way to set these environment variables is to store them as key=value pairs (just like above) in a .conf file (I call it keyboard.conf) and save it in $HOME/.config/environment.d/ for systemd to catch them. You may have to create the environment.d folder.

I set these variables using systemd because other places are usually trickier -- .bashrc may not work if you don't use bash, /etc/profile and /etc/environment require root access, Wayland won't catch XOrg variables at all... Again, it's a mess. But this seems to be the best working solution so far.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by