asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.47k stars 1.27k forks source link

[Question] Does pyautogui work with wayland? #747

Open damies13 opened 1 year ago

damies13 commented 1 year ago

I am using imagehorizonlibrary that uses pyautogui, when I am using Ubuntu 22.04 with the wayland windowing system all I get is image not found and screen shots that are completely black.

So I am wondering if pyautogui supports wayland?

VictorGimenez commented 1 year ago

There is a long time since Wayland support had been asked also, check out #111 from 2016... I was able to make one update to the original source code of the pyautogui package only involving screenshot. About the screenshots, pyautogui imports the pyscreeze file calling methods from this file, and by his turn this file has with itself methods responsible for image location, if you see, each OS calls a different method so you need to modify the tool that is called on the method correspondent to the Linux OS... and scrot only works with X11 (X Window System), but there are more screenshot tools that work with Wayland how for example gnome-screenshot. Other pyautogui methods responsible for the mouse, keyboard events for his turn call the XLib but @asweigart in one of his posts suggested to use pywayland to it and it looks like that it is in progress

linkyeu commented 1 year ago

Any updates here ?)