Skip to content

qusaismael/ClipGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ ClipGuard

License: MIT Python 3.7+ Platform: Linux

ClipGuard is a lightweight, privacy-focused system tray application for Linux that automatically masks sensitive information in your clipboard. Protect your privacy when copying and pasting emails, phone numbers, credit cards, IP addresses, and more.

Status UI Display Server


โœจ Features

๐Ÿ”’ Automatic Sensitive Data Masking

  • Email addresses โ†’ [REDACTED_EMAIL]
  • Phone numbers (US format) โ†’ [REDACTED_PHONE]
  • IPv4 addresses โ†’ [REDACTED_IP]
  • Credit card numbers โ†’ [REDACTED_CC]
  • Social Security Numbers โ†’ [REDACTED_SSN]

๐Ÿง  Smart Detection

ClipGuard only masks sensitive data when it's part of larger text. If you copy just an email address alone, it won't be maskedโ€”we assume you copied it intentionally.

๐Ÿ”— Link Cleaning

Remove tracking parameters and unwrap redirectors:

  • Strips utm_*, fbclid, gclid, mc_eid, igshid
  • Unwraps Google and Facebook redirectors
  • Converts AMP URLs to canonical form

โš™๏ธ Fully Customizable

  • Enable/disable any built-in rule
  • Add custom regex patterns for your specific needs
  • Settings saved to ~/.config/clipguard/settings.json

๐Ÿ”„ Restore Original Content

Made a mistake? Use "Restore Last Content" to get back the unmasked text anytime.

๐ŸŽจ Beautiful Modern UI

  • Clean, professional interface with emoji icons
  • Tabbed settings dialog with built-in help
  • Smart notifications with content previews
  • Tooltips on every element

๐Ÿš€ Installation

Prerequisites

All distributions require:

  • Python 3.7+
  • xclip or xsel (for clipboard access)

๐Ÿ“ฆ Debian / Ubuntu / Linux Mint / Pop!_OS

# Install system dependencies
sudo apt update
sudo apt install python3 python3-pip python3-venv xclip git

# Clone the repository
git clone https://github.com/qusaismael/ClipGuard.git
cd ClipGuard

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt

# Run ClipGuard
./run.sh

Optional: Add to autostart

mkdir -p ~/.config/autostart
cp clipguard.desktop ~/.config/autostart/

๐Ÿ“ฆ Fedora / RHEL / CentOS

# Install system dependencies
sudo dnf install python3 python3-pip xclip git

# Clone the repository
git clone https://github.com/qusaismael/ClipGuard.git
cd ClipGuard

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt

# Run ClipGuard
./run.sh

Auto-start on Login (Fedora/RHEL):

mkdir -p ~/.config/autostart
cp clipguard.desktop ~/.config/autostart/

๐Ÿ“ฆ Arch Linux / Manjaro

# Install system dependencies
sudo pacman -S python python-pip xclip git

# Clone the repository
git clone https://github.com/qusaismael/ClipGuard.git
cd ClipGuard

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt

# Run ClipGuard
./run.sh

Auto-start on Login (Arch/Manjaro):

mkdir -p ~/.config/autostart
cp clipguard.desktop ~/.config/autostart/

AUR Package (Coming Soon)

yay -S clipguard

๐Ÿ“ฆ openSUSE

# Install system dependencies
sudo zypper install python3 python3-pip xclip git

# Clone the repository
git clone https://github.com/qusaismael/ClipGuard.git
cd ClipGuard

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip install -r requirements.txt

# Run ClipGuard
./run.sh

Auto-start on Login (openSUSE):

mkdir -p ~/.config/autostart
cp clipguard.desktop ~/.config/autostart/

๐Ÿ“ฆ Universal Install (Any Distribution)

If your distribution isn't listed above:

# Ensure you have Python 3.7+ and pip installed
python3 --version
pip3 --version

# Install xclip or xsel (check your package manager)
# Examples:
# sudo apt install xclip       # Debian-based
# sudo dnf install xclip       # Fedora-based
# sudo pacman -S xclip         # Arch-based
# sudo zypper install xclip    # openSUSE

# Clone and set up
git clone https://github.com/qusaismael/ClipGuard.git
cd ClipGuard
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
./run.sh

๐Ÿ“– Quick Start

1. Launch ClipGuard

./run.sh

or

python3 main.py

2. Verify It's Running

Look for a green shield icon (๐Ÿ›ก๏ธ) in your system tray.

3. Test Masking

Copy this text:

Contact me at john.doe@example.com or call 555-123-4567

Paste it somewhere and you should see:

Contact me at [REDACTED_EMAIL] or call [REDACTED_PHONE]

4. Test Restore

Right-click the tray icon โ†’ "๐Ÿ”„ Restore Last Content" โ†’ Paste again to see the original.

5. Explore Settings

Right-click the icon โ†’ "โš™๏ธ Settings"

  • Browse built-in rules
  • Add custom patterns
  • Read the Help tab for examples

๐ŸŽฏ Usage

System Tray Menu

Right-click the ClipGuard icon to access:

๐Ÿ“Š Status
  โธ๏ธ  Stop Monitoring       Toggle protection on/off

โšก Quick Actions
  ๐Ÿ”„  Restore Last Content  Get back unmasked text
  ๐Ÿ”—  Clean Last Link       Remove URL tracking

  โš™๏ธ  Settings              Customize masking rules
  โ„น๏ธ  About ClipGuard       Learn about features

  โŒ  Quit                  Exit application

Adding Custom Rules

  1. Open Settings from the tray menu
  2. Go to the "๐Ÿ”’ Masking Rules" tab
  3. Fill in the "Add Custom Rule" section:
    • Name: Descriptive name (e.g., "API Key")
    • Pattern: Regex pattern (e.g., sk-[A-Za-z0-9]{48})
    • Replacement: Placeholder (e.g., [REDACTED_API_KEY])
  4. Click "โž• Add Rule"
  5. Click "๐Ÿ’พ Save & Close"

Examples:

Name Pattern Replacement
OpenAI API Key sk-[A-Za-z0-9]{48} [REDACTED_API_KEY]
Bitcoin Address \b[13][a-km-zA-HJ-NP-Z1-9]{25,34}\b [REDACTED_BTC]
Employee ID EMP-\d{6} [REDACTED_EMP_ID]
AWS Key AKIA[0-9A-Z]{16} [REDACTED_AWS_KEY]

๐Ÿ–ฅ๏ธ Desktop Integration

Add to Application Menu (All Distributions)

mkdir -p ~/.local/share/applications
cp clipguard.desktop ~/.local/share/applications/
chmod +x ~/.local/share/applications/clipguard.desktop
update-desktop-database ~/.local/share/applications

ClipGuard will now appear in your application menu under "Utilities" or "Security".

Auto-Start on Login (All Distributions)

Make ClipGuard start automatically when you log in:

mkdir -p ~/.config/autostart
cp clipguard.desktop ~/.config/autostart/

This works on all distributions:

  • โœ… Ubuntu / Debian / Linux Mint / Pop!_OS
  • โœ… Fedora / RHEL / CentOS
  • โœ… Arch Linux / Manjaro
  • โœ… openSUSE
  • โœ… Any distribution with XDG autostart support

Verify it's enabled:

ls -la ~/.config/autostart/clipguard.desktop

To disable autostart:

rm ~/.config/autostart/clipguard.desktop

System Tray Icon Not Showing?

GNOME Users: Install the "AppIndicator and KStatusNotifierItem Support" extension.

# Ubuntu/Debian
sudo apt install gnome-shell-extension-appindicator

# Fedora
sudo dnf install gnome-shell-extension-appindicator

# Arch
sudo pacman -S gnome-shell-extension-appindicator-git

Then enable it in GNOME Extensions/Tweaks.


๐Ÿ“‹ Configuration

Settings are stored in: ~/.config/clipguard/settings.json

Example configuration:

{
  "monitoring_active": true,
  "builtin_patterns": {
    "Email": {
      "pattern": "\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b",
      "replacement": "[REDACTED_EMAIL]",
      "enabled": true
    }
  },
  "custom_patterns": {
    "API Key": {
      "pattern": "sk-[A-Za-z0-9]{48}",
      "replacement": "[REDACTED_API_KEY]",
      "enabled": true,
      "custom": true
    }
  }
}

๐Ÿงช Testing

Run the included test scripts to verify functionality:

Test Cross-Application Monitoring

./test_cross_app.py

Test Restore Feature

./test_restore.py

For comprehensive testing instructions, see TESTING.md.


๐Ÿ› ๏ธ Troubleshooting

Clipboard Not Being Monitored

  1. Check monitoring is enabled: Icon should be green
  2. Install xclip or xsel: sudo apt install xclip
  3. Check console for errors: python3 main.py

System Tray Icon Not Showing

  1. Install system tray extension (see Desktop Integration above)
  2. Check if your DE supports system tray
  3. Try restarting your desktop environment

Permission Errors

chmod +x run.sh main.py test_*.py

Python Dependencies Issues

# Update pip
pip install --upgrade pip

# Reinstall dependencies
pip install -r requirements.txt --force-reinstall

๐Ÿ“š Documentation


๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/qusaismael/ClipGuard.git
cd ClipGuard

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run in development mode
python3 main.py

Code Style

  • Follow PEP 8
  • Add docstrings to functions and classes
  • Comment complex logic
  • Test your changes thoroughly

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

Built with:

  • PyQt6 - Modern GUI framework
  • pyperclip - Cross-platform clipboard access
  • Python 3 - Powerful and elegant

Inspired by the need for privacy-conscious computing on Linux.


๐ŸŒŸ Stars

If you find ClipGuard useful, please consider giving it a star! โญ


๐Ÿ” Security

ClipGuard processes all data locally on your machine. No data is ever sent over the network.

If you discover a security vulnerability, You can open an issue above.


๐Ÿ—บ๏ธ Roadmap

  • Support for more data types (passport numbers, dates of birth, etc.)
  • Multi-language phone number support
  • Clipboard history with auto-masking
  • Export/import custom rules
  • Dark mode theme
  • Flatpak/Snap package
  • Wayland-native implementation

๐Ÿ’ Support This Project

If ClipGuard helps protect your privacy, consider:

  • โญ Starring this repository
  • ๐Ÿ› Reporting bugs you encounter
  • ๐Ÿ’ก Suggesting features you'd like to see
  • ๐Ÿ“– Contributing code or documentation
  • ๐Ÿ—ฃ๏ธ Spreading the word to friends and colleagues

Made with โค๏ธ for privacy-conscious Linux users

ClipGuard v1.0 | October 2025

About

ClipGuard is a tray application for Linux that automatically masks sensitive information in your clipboard.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก