mooz/xkeysnail

NameError: name 'define_keymap' is not defined

Gieted opened this issue · 1 comments

I'm using Fedora Workstation 33.

I've followed the installation guide, but I get NameError: name 'define_keymap' is not defined when trying to run sudo xkeysnail ~/.xkeysnail.py.

Full output:

Traceback (most recent call last):
  File "/usr/local/bin/xkeysnail", line 6, in <module>
    cli_main()
  File "/usr/local/lib/python3.9/site-packages/xkeysnail/__init__.py", line 62, in cli_main
    eval_file(args.config)
  File "/usr/local/lib/python3.9/site-packages/xkeysnail/__init__.py", line 6, in eval_file
    exec(compile(file.read(), path, 'exec'), globals())
  File ".xkeysnail.py", line 1, in <module>
    define_keymap(None, {K("M-j"): K("LEFT")})
NameError: name 'define_keymap' is not defined
Exception ignored in: <function InputDevice.__del__ at 0x7f083bed78b0>
Traceback (most recent call last):
  File "/usr/local/lib64/python3.9/site-packages/evdev/device.py", line 160, in __del__
  File "/usr/local/lib64/python3.9/site-packages/evdev/device.py", line 305, in close
  File "/usr/local/lib64/python3.9/site-packages/evdev/eventio_async.py", line 55, in close
  File "/usr/lib64/python3.9/asyncio/events.py", line 725, in get_event_loop_policy
  File "/usr/lib64/python3.9/asyncio/events.py", line 718, in _init_event_loop_policy
ImportError: sys.meta_path is None, Python is likely shutting down

Can be fixed by adding from xkeysnail.transform import * to configuration file