clipboard API for the autokey-gtk application on X11
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 Gtk implementation.
- class autokey.scripting.clipboard_gtk.GtkClipboard(app=None)[source]
Read/write access to the X selection and clipboard - GTK version
- fill_clipboard(contents)[source]
Copy text into the clipboard
Usage:
clipboard.fill_clipboard(contents)- Parameters:
contents – string to be placed in the selection
- fill_selection(contents)[source]
Copy
contentsinto the X selectionUsage:
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