This Python-based clipboard manager allows you to securely monitor, store, and manage your clipboard history. The program keeps track of your clipboard content, stores it in a JSON file with timestamps, and automatically removes clipboard history older than 24 hours. It runs continuously in the background, making it easy to review or manage past clipboard entries.
The script also supports both encrypted and plaintext storage of clipboard history.
-
Continuously monitors clipboard content.
-
Saves clipboard history with timestamps.
-
Automatically deletes clipboard history older than 24 hours.
-
Optionally encrypts clipboard history for secure storage.
-
Lightweight and runs in the background.
-
Runs on macOS and Linux.
Before using this project, ensure you have Python 3.6+ installed. You will also need the following Python libraries:
-
pyperclip: For interacting with the clipboard. -
cryptography: For optional encryption of clipboard data (if required). -
json: Built-in for handling JSON files. -
os,time,datetime: Standard libraries for file and time management.
Create a virtual environment (recommended):
python3 -m venv venv
source venv/bin/activate # macOS/Linux
- Run the file using
python clip_manager.py
To run the clipboard manager continuously, even after terminal closure:
Option 1: Using Cron Jobs (Linux/macOS)
Edit your crontab:
crontab -e
Add the following line to run the script every 5 minutes (adjust as needed):
*/5 * * * * /path/to/venv/bin/python3 /path/to/clip_manager.py
The script automatically removes clipboard history that is older than 24 hours. The remove_old_history function is executed periodically to filter out old entries from the clipboard_history.json file.
If you'd like to contribute to this project, feel free to open a pull request or submit an issue. All contributions are welcome!