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

Doesn't work on Wayland only XOrg #2

Open
YusufMavzer opened this issue May 12, 2021 · 8 comments
Open

Doesn't work on Wayland only XOrg #2

YusufMavzer opened this issue May 12, 2021 · 8 comments

Comments

@YusufMavzer
Copy link

Fedora 34 uses wayland and this one doesn't work on it

@alphamarket
Copy link

Hey there... Are you going to do something to fix this issue?

@YusufMavzer
Copy link
Author

I'm not the one that implemented this but I can create a fix if you want

@YusufMavzer
Copy link
Author

an update. We'll have to wait for this to be closed
moses-palmer/pynput#331

@carrot69
Copy link
Owner

carrot69 commented Aug 4, 2021

Indeed, keep-presence uses pynput who is currently having issues as well with Wayland.
Once they fix it, we should be fine!

Anyway, if someone finds a bugfix, please create a PR or tell me and I'll submit the changes.

@austinsr1
Copy link

austinsr1 commented Jun 28, 2022

This might not be ideal, since it requires sudo/root to move the mouse, but evemu-event does work.
Example that I found on an ask ubuntu thread:
sudo evemu-event /dev/input/event5 --type EV_REL --code REL_X --value 50
sudo evemu-event /dev/input/event5 --type EV_REL --code REL_Y --value 50
sudo evemu-event /dev/input/event5 --type EV_KEY --code BTN_RIGHT --value 1
sudo evemu-event /dev/input/event5 --type EV_KEY --code BTN_RIGHT --value 0

Added the X and Y move commands into the is_user_away: function and its up and going again.

@shadeep
Copy link

shadeep commented Nov 28, 2022

I get the following error when running keep-presence with Wayland on Fedora 37.

Traceback (most recent call last):
  File "/snap/keep-presence/96/keep-presence.py", line 6, in <module>
    from pynput.mouse import Controller as MouseController
  File "/snap/keep-presence/96/lib/python3.6/site-packages/pynput/__init__.py", line 40, in <module>
    from . import keyboard
  File "/snap/keep-presence/96/lib/python3.6/site-packages/pynput/keyboard/__init__.py", line 31, in <module>
    backend = backend(__name__)
  File "/snap/keep-presence/96/lib/python3.6/site-packages/pynput/_util/__init__.py", line 82, in backend
    if resolutions else '')
ImportError: this platform is not supported: ('failed to acquire X connection: Can\'t connect to display ":0": b\'Authorization required, but no authorization protocol specified\\n\'', DisplayConnectionError(':0', b'Authorization required, but no authorization protocol specified\n'))

Stumbled across this while looking for a solution. Running the following solves the authorization issue:
xhost si:localuser:<user-id>

See:
https://stackoverflow.com/questions/48833451/no-protocol-specified-when-running-a-sudo-su-app-on-ubuntu-linux

@suncoastkid
Copy link

Is this project dead? Still seeing this issue open from two year ago and having the same issue with it not working on Wayland.

@carrot69
Copy link
Owner

carrot69 commented Nov 28, 2023

an update. We'll have to wait for this to be closed moses-palmer/pynput#331

@suncoastkid keep-presence uses the pynput library, we have to wait for pynput to fix the problem.

https://pynput.readthedocs.io/en/latest/limitations.html?highlight=wayland#linux

@carrot69 carrot69 pinned this issue Feb 3, 2024
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

No branches or pull requests

6 participants