clipboard#

Description#

Plugin to programmatically copy strings to your system clipboard, monitor and get the current clipboard content.

param poll_interval:

How often the ClipboardPlugin.loop function should be executed (default: 15 seconds). NOTE: For back-compatibility reasons, the poll_seconds argument is also supported, but it’s deprecated.

param stop_timeout:

How long we should wait for any running threads/processes to stop before exiting (default: 5 seconds).

param disable_monitor:

If set to True then the plugin will not monitor for new events. This is useful if you want to run a plugin in stateless mode and only leverage its actions, without triggering any events. Defaults to False.

Configuration#

clipboard:
  # [Optional]
  # How often the `RunnablePlugin.loop <https://docs.platypush.tech/platypush/plugins/.html#platypush.plugins.RunnablePlugin.loop>`_ function should be
  # executed (default: 15 seconds). *NOTE*: For back-compatibility
  # reasons, the `poll_seconds` argument is also supported, but it's
  # deprecated.
  # poll_interval: 15  # type=Optional[float]

  # [Optional]
  # How long we should wait for any running
  # threads/processes to stop before exiting (default: 5 seconds).
  # stop_timeout: 5  # type=Optional[float]

  # [Optional]
  # If set to True then the plugin will not monitor
  # for new events. This is useful if you want to run a plugin in
  # stateless mode and only leverage its actions, without triggering any
  # events. Defaults to False.
  # disable_monitor: False  # type=bool

Dependencies#

pip

pip install pyclip

Alpine

apk add py3-pyclip

Fedora

yum install python-pyclip

Arch Linux

pacman -S python-pyclip

Triggered events#

Actions#

Module reference#

class platypush.plugins.clipboard.ClipboardPlugin(*args, **kwargs)[source]#

Bases: RunnablePlugin

Plugin to programmatically copy strings to your system clipboard, monitor and get the current clipboard content.

__init__(*args, **kwargs)[source]#
Parameters:
  • poll_interval – How often the loop() function should be executed (default: 15 seconds). NOTE: For back-compatibility reasons, the poll_seconds argument is also supported, but it’s deprecated.

  • stop_timeout – How long we should wait for any running threads/processes to stop before exiting (default: 5 seconds).

  • disable_monitor – If set to True then the plugin will not monitor for new events. This is useful if you want to run a plugin in stateless mode and only leverage its actions, without triggering any events. Defaults to False.

copy(text)[source]#

Copies a text to the OS clipboard

Parameters:

text (str) – Text to copy

main()[source]#

Implementation of the main loop of the plugin.

paste()[source]#

Get the current content of the clipboard

start()#

Start the plugin.

stop()#

Stop the plugin.

wait_stop(timeout=None)#

Wait until a stop event is received.