Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screenkey: unset XMODIFIERS to avoid XOpenIM err #1

Open
wants to merge 1 commit into
base: screenkey
Choose a base branch
from

Conversation

vidbina
Copy link

@vidbina vidbina commented Feb 12, 2018

Motivation for this change

I know you're tired. So instead of asking you to do it I figured I'll propose a PR. Perhaps it's not as clean as it should be... In that case I'll just keep track of the status on GitHub and submit fixes until we get it right.

point is... on my setup this fails with

DEBUG:Screenkey:Options loaded.
DEBUG:Screenkey:Restarting LabelManager.
DEBUG:Screenkey:Thread started.
DEBUG:Screenkey:Restarting LabelManager.
Exception in thread Thread-1:
Traceback (most recent call last):
  File /nix/store/i3bx1iw2d0i3vh9sa1nf92ynlrw324w8-python-2.7.14/lib/python2.7/threading.py, line 801, in __bootstrap_inner
    self.run()
  File /nix/store/r7dqmjgcp6y72939rwsm0x941k7kd78y-screenkey-0.9/lib/python2.7/site-packages/Screenkey/keylistener.py, line 245, in run
    raise Exception(Cannot initialize input method)
Exception: Cannot initialize input method

zsh: terminated  ./result/bin/screenkey -d

I resolved this in my old PR (NixOS#34898) by unsetting XMODIFIERS. Using wrapProgram, I kind of know how to do this the "right" way, but with wrapGAppsHook I figured appending to gappsWrapperArgs would suffice even though there aren't any examples of unsetting variables this way in the entire nixpkgs repository so far... or my grep was lousy. So I don't really know if this is a clean way of doing this. I already mentioned this PR in NixOS#34167 so I'm counting on feedback soon enough.

Things done
  • Tested using sandboxing
    (nix.useChroot on NixOS,
    or option build-use-chroot in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@vidbina
Copy link
Author

vidbina commented Feb 27, 2018

@rasendubi could you review this and possibly merge it such that we can keep the conversation going on NixOS#34167?

@Mic92
Copy link

Mic92 commented Feb 27, 2018

What is the current value of $XMODIFIER in your shell?

@Mic92
Copy link

Mic92 commented Feb 27, 2018

screenkey was merged into nixpkgs.

@vidbina
Copy link
Author

vidbina commented Feb 27, 2018

XMODIFIERS is set to @im=ibus which is a side-effect of having the ibus package installed as evident in https://github.com/NixOS/nixpkgs/blob/7ef26640f604f7745d07fde71aaa401a3c211149/nixos/modules/i18n/input-method/ibus.nix#L64

@Mic92
Copy link

Mic92 commented Feb 28, 2018

So does this only happen with ibus or also the other input methods?

@rasendubi
Copy link
Owner

@vidbina given my PR is merged now, I think it's better you open a new PR against upstream nixpkgs (and add link here)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants