clipboard API for Wayland environments
This class is invoked as the “clipboard” class in AutoKey scripts. For example, the “autokey.scripting.clipboard_gtk.GtkClipboard.fill_clipboard()” method documented below is called as “clipboard.fill_clipboard()” in an AutoKey script.
There are three different implementations of the “clipboard” class, one for Wayland environments, one for X11/Gtk, and one for X11/Qt. They all offer the exact same methods. This the Wayland implementation.
- class autokey.scripting.clipboard_wayland.WaylandClipboard(app=None)[source]
Read write access to the Wayland desktop using the wl-clipboard utility
- fill_clipboard(contents: str)[source]
Copy text into the clipboard
Usage:
clipboard.fill_clipboard(contents)- Parameters:
contents – string to be placed in the selection
- fill_selection(contents: str)[source]
Copy text into the selection
Usage:
clipboard.fill_selection(contents)- Parameters:
contents – string to be placed in the selection
- get_clipboard()[source]
Read text from the clipboard
Usage:
clipboard.get_clipboard()- Returns:
text contents of the clipboard
- Return type:
str, orbytearrayon Python >= 3.13