Skip to content

rpriven/xclip-ocr

Repository files navigation

📸 xclip-ocr - Quick OCR from Your Screen to Clipboard

License Python Platform PRs Welcome

Table of Contents


✨ Features

  • Fast screenshot-to-text via Flameshot
  • OCR powered by Tesseract v5+ with LSTM neural engine
  • Enhanced OCR quality with smart preprocessing and multiple detection modes
  • Multiple OCR attempts using different page segmentation modes for better accuracy
  • Smart image enhancement that preserves text quality instead of over-processing
  • Automatic clipboard copy (xclip or xsel)
  • Detailed notifications with character and word count
  • Simple hotkey integration

🛠 Prerequisites

  • Python 3.6 or newer
  • Flameshot
  • Tesseract OCR with language data
  • xclip or xsel for clipboard
  • Ensure ~/.local/bin is in your $PATH

🚀 Installation

git clone https://github.com/rpriven/xclip-ocr.git
cd xclip-ocr
python3 install.py

Verifies and installs system dependencies, then copies xclip-ocr.py to ~/.local/bin.


🖱️ Usage

Run the script and select a screen region:

xclip-ocr.py
# Select with Flameshot, then Enter → OCR & clipboard copy

⌨️ Hotkey Setup

  1. Cinnamon (auto-installed): Super + Shift + T bound by install.py.
  2. Manual (any DE):
    • Command: python3 $HOME/.local/bin/xclip-ocr.py
    • Shortcut: your preferred key combo

🧠 Troubleshooting

  • No text? Ensure clear text, install tesseract-ocr and language files.
  • Clipboard issues? Verify xclip/xsel, check $DISPLAY, inspect /tmp/xclip-ocr-debug.txt & error.log.

📂 File Overview

File Description
xclip-ocr.py Main OCR script
install.py Dependency & hotkey setup
README.md Project documentation

🤝 Contributing

Issues & PRs: https://github.com/rpriven/xclip-ocr/issues


📄 License

MIT — see LICENSE

About

Linux OCR screenshot tool with clipboard copy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors