2

I'd love to easily use screenkey on elementary OS to include key presses on screenrecordings but there seem to be input method issues.

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 helpfull 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:

XMODIFIERS=@im=ibus
GTK_IM_MODULE=
QT_IM_MODULE=ibus

So it's not, and apparently I'm not running ibus:

$ pgrep -ax ibus-daemon

Finally 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

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 opened an old issue of mine that I forgot about: https://github.com/elementary/gala/issues/27

  • There's nothing wrong with elementary OS default OS configuration I think. I just installed on my computer with no problem - paste.ubuntu.com/p/6GHsCCVRSd – Cog Apr 24 '19 at 13:11
  • @Cog You only tried installing it? You get the error I mentioned when you try to start it. I've reopened an old issue of mine: github.com/elementary/gala/issues/27 – Peter Uithoven Apr 25 '19 at 23:24
  • Oh sorry, my bad. Yes, I also face the errors while starting it from the command line. I think Its best to close the question here, its not likely to be solved over Q&A. – Cog Apr 26 '19 at 16:58