default-settings
default-settings copied to clipboard
ibus configuration issue
Installing screenkey (0.9-2) by using sudo apt install screenkey and then starting it from the command line I'm seeing this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/Screenkey/keylistener.py", line 245, in run
raise Exception("Cannot initialize input method")
Exception: Cannot initialize input method
When I try the same with a cloned version of the latest version from gitlab.com/wavexx/screenkey I get a helpful popup pointing to a troubleshoot page: https://www.thregr.org/~wavexx/software/screenkey/#troubleshooting
This asked me to check the following environment variables, which should be consistent but aren't:
XMODIFIERS=@im=ibus
GTK_IM_MODULE=
QT_IM_MODULE=ibus
Following their advice and resetting all these environment variables before running it does work.
unset XMODIFIERS
unset GTK_IM_MODULES
unset QT_IM_MODULES
screenkey
I've opened an issue against screenkey in the past where they commented:
It seems that ElementaryOS presets ibus as the default input method without actually running ibus. The required configuration variables are also not completely set (GTK_IM_MODULES is missing), and ibus is left unconfigured as well.
See: https://github.com/wavexx/screenkey/issues/36#issuecomment-301322513
Is there something wrong with the default elementary OS configuration?
Could I have done anything wrong? I find that these environment variables are the same on a fresh image started in a vm.
I didn't find changes to these variables in ~/.profile, ~/.bash_profile or ~/.pam_environment.
I've moved this to https://bugs.launchpad.net/elementaryos: https://bugs.launchpad.net/elementaryos/+bug/1701010
I'm not sure why those https://bugs.launchpad.net/elementaryos/ bugs where not migrated, but this issue still exists. Maybe we can move this issue to https://github.com/elementary/os/ ?
While reading other issues this comment from @ryonakano caught my attention:
elementary OS uses IBus out of the box, but it does not start IBus daemon.
https://github.com/elementary/switchboard-plug-keyboard/issues/231#issuecomment-517914033
Looks like screenkey works just file after starting: ibus-daemon -drx.
In Ubuntu 18.04 screenkey works out of the box. The same environment variables in Ubuntu:
XMODIFIERS=@im=ibus
GTK_IM_MODULE=ibus
QT_IM_MODULE=xim
This ibus-daemon doesn't seem to run by default (just like elementary OS)
Setting GTK_IM_MODULE and QT_IM_MODULE to the same value in elementary OS before running screenkey doesn't seem to help.
It seems that GTK_IM_MODULE is set to ibus on Ubuntu 18.04 and elementary OS Juno (Japanese). However, once I change the system language to English (en_US) of elementary OS, GTK_IM_MODULE is gone and IBus does not start automatically.