You are not logged in.
My compose key works fine in Qt and GTK3 apps (e.g. Firefox), but fails in GTK2 apps (e.g. Pidgin and GIMP). I've tried creating ~/.xprofile with
export GTK_IM_MODULE=xim
export XMODIFIERS="@im=none"then restarting, but this does not help. Oddly enough, this doesn't seem necessary for GTK3 apps.
I'm not sure if relevant, but I checked /usr/lib/gtk-2.0/2.10.0/immodules.cache, and I can see the following present
"/usr/lib/gtk-2.0/2.10.0/immodules/im-xim.so"
"xim" "X Input Method" "gtk20" "/usr/share/locale" "ko:ja:th:zh" This .so file also exists. How can I get my compose key working for GTK2 apps?
Last edited by Salkay (2021-08-24 07:26:07)
Offline
GTK_IM_MODULE="xim" gtk-demoworksforme™
Check
tr '\0' '\n' < /proc/$(pidof some_gtk_process)/environto see whether your exports are actually being picked up (or eg. overwritten)
Online
Thanks @seth! You were exactly correct. My exports weren't being picked up. When I manually specified GTK_IM_MODULE in the CLI, it worked fine.
I realised that ~/.xprofile wasn't being sourced because I'm using startx, not a display manager. As per the wiki, I tried modifying ~/.xinitrc
[ -f ~/.xprofile ] && . ~/.xprofile
exec startplasma-x11But this just gave me a black screen with a mouse cursor.
I tried adding '&' after the first line, which let me start X, but xprofile was still not sourced. Finally, I just put export GTK_IM_MODULE=xim directly into ~/.xinitrc, and that worked. I have no idea what I couldn't source the external file though, nor why it would block the second line.
Offline
cat ~/.xprofileOnline
$ cat ~/.xprofile
# to allow compose to work in gtk applications
export GTK_IM_MODULE=xim
export XMODIFIERS="@im=none"EDIT: hang on, let me do more troubleshooting
Last edited by Salkay (2021-08-24 06:44:19)
Offline
Thanks again @seth.
I'm not sure what the problem was, but it's all fine now. I reverted ~/.xprofile and ~/.xinit, and they seem to work fine. Maybe the error earlier was just Plasma being coincidentally buggy when I tested that one time.
To summarise, the following works fine:
$ cat ~/.xinitrc
#!/bin/sh
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
exec startplasma-x11
$ cat ~/.xprofile
# to allow compose to work in gtk applications
export GTK_IM_MODULE=xim
export XMODIFIERS="@im=none"Offline