GtkClipboard API

class autokey.scripting.clipboard_gtk.GtkClipboard(app)[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 onto the clipboard

fill_selection(contents)[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

Raises:

Exception – if no text was found on the clipboard

get_selection()[source]

Read text from the selection

Refers to the currently-highlighted text

Usage: clipboard.get_selection()

Returns:

text contents of the selection

Return type:

str

Raises:

Exception – if no text was found in the selection

selection

Refers to the selection of the clipboard or the highlighted text

set_clipboard_image(path)[source]

Set clipboard to image

Usage: clipboard.set_clipboard_image(path)

Parameters:

path – path to image file

Raises:

OSError – if path does not exist