Skip to main content

A Python automation toolkit that supports Wayland.

Project description

waydotool

A Python automation toolkit that supports Wayland.

Fully typed and has docstrings. Supports Windows, macOS, Linux (X11 / Wayland).

Warnings

Work on this project is still in progress. Contributions are welcome.

Input mostly works across all platforms, with the exception of scrolling the mouse wheel being only supported on Wayland. Additionally, to query the mouse position on Wayland, only KDE Plasma >= 6 is supported. (X11/Windows/macOS is fine).

Managing Windows only works on Windows and KWin (X11 / Wayland) (you must be using KDE Plasma >= 6).

Most of it works across both Windows and KWin, with the exception that fullscreening a window is not yet implemented for Windows (for a hacky fallback, you could try focusing the window then sending the F11 keycode).

Feel free to contribute things like adding swayctl support for the window module, or your preferred Window Manager.

And no, this repository wasn't vibe coded. I did have to manually write out all the docstrings (though to be honest there was a fair bit of copying and pasting involved.)

Installation

Prerequisites

  • Wayland
    • ydotool (>=1.0.4) daemon running
    • KDE (>= 6)

If you are not on Wayland, everything should work out-of-the-box.

If you are on Wayland, you will need the ydotool daemon installed and running.

If you are on Wayland but not KDE, some features will be missing.

Installation

$ pip install waydotool

Usage

from waydotool.window import Window
from waydotool import input
import time


windows = Window.search('Firefox')

if not windows:
    print("No window found.")
else:
    firefox = windows[0]

    firefox.activate()

    time.sleep(1)

    input.type('https://github.com/uukelele/waydotool')

    input.key('enter')

There are a lot of exposed functions. They are all documented with docstrings so it should be easy for you to figure out how to use them.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waydotool-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waydotool-0.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file waydotool-0.1.0.tar.gz.

File metadata

  • Download URL: waydotool-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for waydotool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cf0dab16bdb7e5c3aba353a3b66be3969076ea2a75363e5d8dd8b7f93aadf909
MD5 888f6cd074c1664d6155cad8ef72e058
BLAKE2b-256 ff44cf3f58a24fb82f47992bdb628331df996c3ba5e5a22dee1d5dbb92258022

See more details on using hashes here.

File details

Details for the file waydotool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: waydotool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for waydotool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed2ba4791b28b40b4ee05333e042c6ceb990a1dd1e67f9935ca5e241ac87967a
MD5 07256874509b50d7f62dd1e0691f7a9e
BLAKE2b-256 a0fbd9abc487b988c785e7cb8207ddfe9d919046d8ec2d9124f102521818c722

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page