Common API

class autokey.scripting.ColourData(r: int, g: int, b: int)[source]

Colour data type for colour chooser dialogs.

static from_html(html_style_colour_str: str)[source]

Parser for KDialog output, which outputs a HTML style hex code like #55aa00

Parameters:

html_style_colour_str – HTML style hex string encoded colour. (#rrggbb)

Returns:

ColourData instance

Return type:

ColourData

static from_zenity_tuple_str(zenity_tuple_str: str)[source]

Parser for Zenity output, which outputs a named tuple-like string: “rgb(R, G, B)”, where R, G, B are base10 integers.

Parameters:

zenity_tuple_str – tuple-like string: “rgb(r, g, b), where r, g, b are base10 integers.

Returns:

ColourData instance

Return type:

ColourData

property hex_code: str

Returns rgb in hex format

property html_code: str

Converts the ColourData into a HTML-style colour, equivalent to the KDialog output.

property zenity_tuple_str: str

Converts the ColourData into a tuple-like string, equivalent to the Zenity output. (“rgb(R, G, B)”)

class autokey.scripting.DialogData(return_code: int, data: ColourData | str | List[str] | None)[source]

Dialog data type for return values from input dialogs

property successful: bool

Returns True, if the dialog execution was successful, i.e. KDialog or Zenity exited with a zero return value. This includes: - Command line parameters are correct - Execution is otherwise successful (Can open X Display, load shared libraries, etc.) - The user clicked on OK or otherwise ‘accepted’ the dialog.