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\n' on Wayland #280

Open
george72 opened this issue Jun 5, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@george72
Copy link
Contributor

george72 commented Jun 5, 2023

Description

Can not send whatsapp text message in Fedora 38 with Wayland

To Reproduce

import pywhatkit
pywhatkit.sendwhatmsg(phone_no="520000000001", message="Hi", wait_time=15, time_min=33)

Same config in Windows 10 works fine. It seems to be a problem with Wayland.

Version Information

@george72 george72 added the bug Something isn't working label Jun 5, 2023
@techbyds
Copy link

techbyds commented Jun 12, 2023

Description:

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

Reproduce:

import pywhatkit
pywhatkit.sendwhatmsg("+34xxxxx", "test py", 13,22,8)

Version:

OS: Ubuntu 23.04 (Luna Lobster)
browser: chrome
python: 3.11.2
pywhatkit: 5.4

@george72
Copy link
Contributor Author

This error is exclusively on Wayland OS.

I can confirm that if you run it on a KDE with X11 like Fedora 38 KDE it just works as designed (be sure to log in with X11 not Wayland).

Pywhatkit needs a Wayland update, not sure if it is a small task but since all linux seems to move to Wayland it needs to get fixed.

@techbyds
Copy link

techbyds commented Jul 2, 2023

@george72 Or Wayland needs an update ;)

Wayland is still under development, and there are still applications and behaviours that don’t work as expected, you may find that some applications have not been updated to work properly in Wayland and currently the only way these applications will run is using Xorg instead of Wayland. source

@george72
Copy link
Contributor Author

george72 commented Jul 7, 2023

I had to change Fedora 38 from Wayland to Xorg to be able to run Pywhatkit.

Expecting a Wayland compatibility update does not look like the way to go. It's better to have Pywhatkit running natively on Wayland.

Steps to change Fedora Wayland to Xorg:
Changing the default GNOME session via configuration file

As an alternative, this change can be made by editing a configuration file /etc/gdm/custom.conf.

Open /etc/gdm/custom.conf and uncomment the line:

WaylandEnable=false

Add the following line to the [daemon] section:

DefaultSession=gnome-xorg.desktop

Save the custom.conf file.

Logout or reboot to enter the new session.

Link to change Fedora Wayland Default to Xorg so it can run Pywhatkit:
https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants