Signature
(value=None, *, notify=True, when=None)
Docstring
Extracts or updates the clipboard contents.
Args:
value (str, optional): The value to copy to clipboard. If None, only reads the clipboard.
notify (bool, optional): Whether to send a GUI notification. Default is True.
when (str | Pattern, optional): If provided, must match clipboard contents.
Acts as a gatekeeper: if there's no match, returns None and skips updating.
Returns:
str | None: The previous clipboard content, or None if `when` did not match.
Sample CLI
gway clip purge
Signature
(*, history=False)
Docstring
Clears clipboard and optionally wipes history file.
Sample CLI
gway clip track-history
Signature
(interval: int = 5, *, stop_after=None, notify=True)
Docstring
Tracks clipboard history by polling at regular intervals.
Args:
interval (int): Seconds to wait between checks. Default is 5 seconds.
stop_after (int | None): Optional maximum duration (in seconds) before stopping.
notify (bool): Whether to show GUI notifications for new entries.
Writes:
Appends new clipboard entries to 'work/clip/history.txt', separated by '
...
'.
Sample CLI
gway clip view-history
Signature
(*, selection: list = None, copy: bool = True, purge: bool = True)
TODOs
# TODO: If copy, concatenate selection, copy to clipboard
# TODO: If purge, remove listed all items by sequence from history.txt
Sample CLI
gway release changes
Signature
(*, files=None, staged=False, context=3, max_bytes=200000, clip=False)
Docstring
Returns a unified diff of all recent textual changes in the git repo.
- Shows added/removed lines (ignores binary files).
- Includes unstaged (working directory) by default. Use staged=True to see only staged.
- 'files': Optionally filter by path(s) or file glob(s).
- 'context': Number of context lines in the diff (default 3).
- 'max_bytes': Truncate diff if too large (default 200,000).