Clipfix is a small Python tray app that watches the clipboard and rewrites matching text with configurable regex rules. It is meant for quick local cleanup tasks such as removing tracking parameters, extracting IDs from URLs, or normalizing links you copy often.
- Monitors clipboard text in the background.
- Applies ordered
regex_replacerules fromruleset.yaml. - Reloads the ruleset automatically while running.
- Supports per-rule enable flags and stop-after-match behavior.
- Provides a tray icon with an Exit menu item.
- Python 3
- Python packages:
pyperclippystraypyyamlpillow
Install the packages with:
python -m pip install -e .On Windows, py can be used instead:
py -m pip install -e .Run the app from the repository directory:
clipfixOn Windows, run_clipfix.bat is included only as an ease-of-use launcher. It starts clipfix.py with pyw or pythonw when available so the app can run without a console window.
When Clipfix is running, copy text as usual. If the clipboard text matches an enabled rule, Clipfix replaces the clipboard contents with the transformed value.
Rules live in ruleset.yaml next to clipfix.py.
rules:
- name: "Remove ChatGPT UTM source"
enabled: true
type: regex_replace
pattern: '\?utm_source=chatgpt\.com$'
replacement: ''
stop_after_processing: falseRule fields:
name: Human-readable rule name used in logs.enabled: Set totrueto activate the rule.type: Currently expected to beregex_replace.pattern: Python regular expression to match clipboard text.replacement: Replacement string passed tore.sub.stop_after_processing: Stop applying further rules after this rule changes the text.
Rules are applied in file order. Clipfix checks for ruleset changes every few seconds and keeps the previous rules if a reload fails.
clipfix.py: Main tray application and clipboard monitor.ruleset.yaml: Editable regex rules.clipboard_icon.png: Tray icon.run_clipfix.bat: Optional Windows convenience launcher.
MIT License. See LICENSE.