wavexx / screenkey

A screencast tool to display your keys inspired by Screenflick
https://www.thregr.org/~wavexx/software/screenkey/
GNU General Public License v3.0
758 stars 65 forks source link

Elementary OS cannot install #36

Closed jrock2004 closed 6 years ago

jrock2004 commented 8 years ago

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

wavexx commented 8 years ago

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.

jrock2004 commented 8 years ago

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

image

wavexx commented 8 years ago

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

pgrep ibus-daemon
env |grep IM
jrock2004 commented 8 years ago

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
mrmakr commented 7 years ago

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

wavexx commented 7 years ago

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

peteruithoven commented 7 years ago

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

wavexx commented 7 years ago

On Sun, May 14 2017, Peter Uithoven wrote:

I'm also running into this issue on ElementaryOS.

Did you customize the locale of ElementaryOS? Is this the usual en_US, or anything special?

peteruithoven commented 7 years ago

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: https://github.com/elementary/switchboard-plug-locale/issues/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=
wavexx commented 7 years ago

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?

wavexx commented 7 years ago

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.

peteruithoven commented 7 years ago

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.

peteruithoven commented 7 years ago

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.

wavexx commented 7 years ago

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.

peteruithoven commented 7 years ago

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.

wavexx commented 7 years ago

On Wed, Jun 28 2017, Peter Uithoven wrote:

That works!

Yes, as I wrote before, it's a bug in ElementaryOS.

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

Yes, screenkey detaches by default (you can control it in the system tray). Use --no-detach to supress this behavior.

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 tried as well, but I have no experience with ElementaryOS. If you can, you should try to file a report somewhere and point their staff to this page.

This is a major configuration issue with ElementaryOS. It's going to break other programs as well.

peteruithoven commented 7 years ago

I've opened an ElementaryOS issue: https://bugs.launchpad.net/elementaryos/+bug/1701010

thapakazi commented 7 years ago

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

wavexx commented 7 years ago

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...

thapakazi commented 7 years ago

lets make one, shall we ;)

wavexx commented 6 years ago

See #56, so closing this.