wavexx/screenkey

Elementary OS cannot install

Closed this issue · 21 comments

Cloned the repo and did the install. When I try to run the program I get the following error

screenshot from 2016-11-15 17 24 18

Do you know what input method are you using? ibus/fcitx?

The first errors are related to gtk (you're at least missing the gtk2-engines-pixbuf package).
The last error ("cannot initialize input method") is usually a sign of improperly configured keyboard/im settings.

I installed the gtk2 app. I am not sure which input method I am using,

image

Do you know if you're using ibus?
Can you show the output of:

pgrep ibus-daemon
env |grep IM

First command came up empty. The second command gave me this

⇨ env | grep IM                                                                                                       
QT_IM_MODULE=ibus
XDG_RUNTIME_DIR=/run/user/1000
REPORTTIME=10

I have the same problem:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/home/xx/screenkey/Screenkey/inputlistener.py", line 330, in run
self._kbd_init()
File "/home/xx/screenkey/Screenkey/inputlistener.py", line 266, in _kbd_init
raise Exception("Cannot initialize input method")
Exception: Cannot initialize input method

pgrep ibus-daemon
env |grep IM
gives:
QT_IM_MODULE=xim
CLUTTER_IM_MODULE=xim
GTK_IM_MODULE=xim
QT4_IM_MODULE=xim

However 0.2 works, but crashes when i click the tray icon... Im on debian strech
edit: got it working with: screenkey -d --show-settings --no-detach

Please create a separate report if you're not on elementary os.

I'm also running into this issue on ElementaryOS.

$ ./screenkey
peteruithoven@xps:~/Downloads/screenkey-0.9$ Gtk-Message: Failed to load module "pantheon-filechooser-module"
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 "/home/peteruithoven/Downloads/screenkey-0.9/Screenkey/keylistener.py", line 245, in run
    raise Exception("Cannot initialize input method")
Exception: Cannot initialize input method
$ env | grep IM                                                                                                       
QT_IM_MODULE=ibus
XDG_RUNTIME_DIR=/run/user/1000
REPORTTIME=10

Just in case it's useful:
screenshot from 2017-05-14 02 36 30

image
The Language & Region list was empty for some reason. I tried adding English I then got a notification that I still had to install some things, which I did. It requested me to logout and login again. But now it's empty again. And I still get the same error when starting screenkey.
I'll look into the empty languages list issue. (opened: elementary/switchboard-plug-locale#21)

Running locale gives:

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=nl_NL.UTF-8
LC_TIME=nl_NL.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION=nl_NL.UTF-8
LC_ALL=

I tried setting Formats to United States as well, resulting in the following locale, but that still gives the same error when starting screenkey.

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

Ok, I tried to use elementaryos inside a VM, and I got the same problem.
Can you try to run:

unset XMODIFIERS
./screenkey -d

from the latest git sources?

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.

Unsetting XMODIFIERS fixes screenkey for me, but the setup is broken in ElementaryOS itself.
Somebody should file a bug against ElementaryOS and cite this page please.

Could it be that this issue only occors when starting screenkey from a terminal? I've tried installing screenkey again and I can actually start it using the icon.

When it starts however, it almost never works however. I've tried understanding when it does work but haven't been able to figure it out.

Did you try to run it in the terminal after running unset XMODIFIERS?
It can be that the environment flags are set differently when running it from the icon, however this is still a bug in ElementaryOS that you should report if you want anybody to pay attention.

That works!

$ unset XMODIFIERS
$ screenkey -d
Gtk-Message: Failed to load module "pantheon-filechooser-module"
DEBUG:Screenkey:Options loaded.
DEBUG:Screenkey:Restarting LabelManager.
DEBUG:Screenkey:Thread started.
DEBUG:Screenkey:Using AppIndicator.
fDEBUG:Screenkey:Key pressed    102(ks): 'f' (f, mask: 00000000)
DEBUG:Screenkey:Label updated: u'\u200c<u>f</u>'.
DEBUG:Screenkey:Key released   102(ks): f
aDEBUG:Screenkey:Key pressed     97(ks): 'a' (a, mask: 00000000)
DEBUG:Screenkey:Label updated: u'\u200cf\u200c<u>a</u>'.
DEBUG:Screenkey:Key released    97(ks): a
DEBUG:Screenkey:Key pressed  65507(ks): None (Control_L, mask: 00000000)

Is it normal that it starts in the background and I can't close it by pressing ctrl-c ?

I've asked in Elementary's Gitter and Slack what would be the right repository to report this issue in. There doesn't seem to be a "general" issue queue.

I am also able to get it fixed by un-setting the XMODIFIERS flag on arch linux ;)
screenshot-20171113-20 23 18

I wished there was some sort of "check my keyboard configuration setup" tool that verifies the coherence of these settings.

It seems that installing and removing input methods will leave users with a broken setup in many distros. I recently helped a colleague with mint as well...

lets make one, shall we ;)

See #56, so closing this.