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

Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'Authorization required, but no authorization protocol specified #1586

Closed
kingdunadd opened this issue Jan 12, 2023 · 9 comments
Labels

Comments

@kingdunadd
Copy link

Bug Description

I just installed plover 4.0.0, and whenever I start it up, it gives this error:
Unexpected error: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/plover/scripts/main.py", line 131, in main code = gui.main(config, controller) File "/usr/lib/python3.10/site-packages/plover/gui_qt/main.py", line 129, in main app = Application(config, controller, use_qt_notifications) File "/usr/lib/python3.10/site-packages/plover/gui_qt/main.py", line 37, in __init__ from plover.gui_qt.main_window import MainWindow File "/usr/lib/python3.10/site-packages/plover/gui_qt/main_window.py", line 15, in <module> from plover.oslayer import wmctrl File "/usr/lib/python3.10/site-packages/plover/oslayer/linux/wmctrl.py", line 4, in <module> _wmctrl = WmCtrl() File "/usr/lib/python3.10/site-packages/plover/oslayer/linux/wmctrl_x11.py", line 9, in __init__ self._display = display.Display() File "/usr/lib/python3.10/site-packages/Xlib/display.py", line 89, in __init__ self.display = _BaseDisplay(display) File "/usr/lib/python3.10/site-packages/Xlib/display.py", line 71, in __init__ protocol_display.Display.__init__(self, *args, **keys) File "/usr/lib/python3.10/site-packages/Xlib/protocol/display.py", line 166, in __init__ raise error.DisplayConnectionError(self.display_name, r.reason) Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'Authorization required, but no authorization protocol specified\n'

To Reproduce

Steps to reproduce the behaviour:

  1. Enter plover into the command line
  2. The error is shown

This happens every time I start up plover.

Expected behavior

Plover should start

Operating system

  • OS: Manjaro Linux, kernel 5.15
  • Plover Version: plover-git 4.0.0.dev12-1 (installed from the AUR)

Hardware

There are no external keyboards connected, this is just my laptop.

Other Notes

This seems like a similar issue to #1137, however after I tried the solutions there plover still throws an error.
One person mentioned deleting ~/.Xauthority, however this does not exist on my computer.

As mentioned in #1137, when I ran python -c 'from Xlib.display import Display; Display()' the output was:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/usr/lib/python3.10/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/usr/lib/python3.10/site-packages/Xlib/protocol/display.py", line 166, in __init__
    raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'Authorization required, but no authorization protocol specified\n'

Thanks in advance for the help, and I'm happy to give more information if necessary.

@kingdunadd kingdunadd added the bug label Jan 12, 2023
@aerickt
Copy link

aerickt commented Jan 12, 2023

Are you on x or wayland? And which desktop environment are you using? Given the error and the fact that ~/.Xauthority is not present on your system, this sounds like you are running wayland which Plover doesn't officially support.

@kingdunadd
Copy link
Author

I am on wayland, and I'm using GNOME.

@aerickt
Copy link

aerickt commented Jan 13, 2023

You're best off switching to x until Plover supports wayland.

@kingdunadd
Copy link
Author

Alright, and thanks for your help.

@ChildishGiant
Copy link

This will need fixing eventually as most all distros are slowly moving towards wayland as default.

@user202729
Copy link
Member

@ChildishGiant #1461 .

@random-integer
Copy link

Hmm... yesterday I tested out Plover on Gnome on Xorg and ran into the same error. A workaround is running xhost + every time before starting Plover, but that is far from satisfactory.

Here's what I've actually done:

  1. Found out that Plover doesn't work on Wayland while reading the Plover Installation Guide
  2. Decided to test out Plover on Wayland anyways
  3. Ran in to this Xlib.error.DisplayConnectionError, and Plover wouldn't start
  4. Ran xhost + before starting Plover, and Plover did start
  5. Plover still didn't work though. Didn't output anything
  6. Tried out Plover on Xorg
  7. Ran into the same Xlib.error.DisplayConnectionError again. Plover refused to start
  8. Applied the same workaround of xhost +, and Plover started
  9. Plover worked

I don't think this issue is caused by Wayland.

@aerickt
Copy link

aerickt commented Mar 4, 2024

I'm on Fedora 39 and the xhost+ workround helps to get Plover started on Wayland (though, output is not working).

@Zylanx
Copy link

Zylanx commented Mar 5, 2024

Hmm... yesterday I tested out Plover on Gnome on Xorg and ran into the same error. A workaround is running xhost + every time before starting Plover, but that is far from satisfactory.

I'm running into this issue under X11 (GNOME, NixOS). My issue I think is related to this issue: https://bugs.launchpad.net/ubuntu/+source/python-xlib/+bug/1885304

Running xhost +si:localuser:$USER also fixed it so I think the issue is with the python library.

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

No branches or pull requests

6 participants