x11pygrid icon indicating copy to clipboard operation
x11pygrid copied to clipboard

Xlib.error.BadAccess install bug

Open SimonDedman opened this issue 6 years ago • 5 comments

Hey Michael,

Looking to install pygrid, thanks for the clear instructions. Hitting a wall immediately though:

$ ./pygrid.py
Writing default config: /home/simon/.config/pygrid.json
PyGrid running. Press CTRL+C to cancel.
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 15, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 16, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 17, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 18, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 19, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 20, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 21, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 22, major_opcode = 33, minor_opcode = 0
X protocol error:
<class 'Xlib.error.BadAccess'>: code = 10, resource_id = 492, sequence_number = 23, major_opcode = 33, minor_opcode = 0

For info:

$ Xorg -version
/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
$ apt-cache show xserver-xorg | grep Version
Version: 1:7.7+19ubuntu8
$ python -V
Python 2.7.15+
$ apt-cache show python-xlib | grep Version
Version: 0.23-2
$ lsb_release -a
LSB Version:	core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 18.10
Release:	18.10
Codename:	cosmic
$ printf 'Desktop: %s\nSession: %s\n' "$XDG_CURRENT_DESKTOP" "$GDMSESSION"
Desktop: XFCE
Session: xubuntu

Any thoughts? Run as sudo?

Thanks!

SimonDedman avatar Feb 21 '19 20:02 SimonDedman

Just got the same error and it's because the keys are already bound.

You either need to remove the current bindings or change ~/.config/pygrid.json

I'm on a laptop without numpad so I use super + alt as modifieras and then number 0 to 9.

So my keys looks like this

"keys": {
    "accelerator": "<Mod1><Mod4>",
    "commands": {
      "0": "maximize",
      "1": "bottomleft",
      "2": "bottom",
      "3": "bottomright",
      "4": "left",
      "5": "middle",
      "6": "right",
      "7": "topleft",
      "8": "top",
      "9": "topright"
    }
  }

I'm also on Xubuntu.

npetzall avatar Feb 28 '19 15:02 npetzall

Good intel Nils, & looking very sharp in your wedding gear there mate!

I'll give it a try this weekend. Cheers!

SimonDedman avatar Feb 28 '19 23:02 SimonDedman

Thanks for the feedback. If this works for you this weekend, let me know and I'll look ad adding a better error message for future users.

pkkid avatar Mar 01 '19 02:03 pkkid

Trying this now. Michael one thing for future updates of the readme file, it would be nice to explain how the default shortcuts (alt+ctrl+numpads) translate to the accelerator which Nils changed (crtl mod1 mod2 as default, mod1 mod4 for Nils' edit. Maybe these are python's names for specific keys? Or ubuntu standards? Either way it would be nice to help the user understand what these are.

Next thing is that I don't have anything bound to alt+crtl+numpads according to my keyboard application shortcuts (though I have a dim memory of there being other key bindings stored somewhere else as well maybe...?). I changed to Nils' settings and it worked fine but still kinda odd.

SimonDedman avatar Mar 03 '19 07:03 SimonDedman

Similarly: it would be good to point users to a list of acceptable key names. Again, IDK if these are python or linux or what, so if I want to change from numpad to arrows, IDK what arrow names are. Possibly these: http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/key-names.html ? Would be good to point to something like this in the readme. Though Left Right Up Down Prior Next don't work on my laptop with no numpad...

SimonDedman avatar May 01 '19 16:05 SimonDedman