This script provides an easy and convenient way to capture screenshots and extract text using OCR (Optical Character Recognition) with Flameshot, Tesseract, and xclip. It is designed for Linux users and supports multiple desktop environments.
To use this script, follow these steps:
-
Clone the Repository:
git clone git@github.com:galexbh/ocr-plugin-flameshot.git
-
Change Directory:
cd ocr-plugin-flameshot
-
Execute Install Script:
chmod +x install.sh
-
Execute Install Script:
./install.sh
Post-installation, find the OCR script (flameshot_ocr.sh) in ~/.ocr/.
Default OCR language is Spanish. To switch languages:
-
Change the language package in install.sh from
tesseract-data-spa
totesseract-data-eng
. -
Modify flameshot_ocr.sh, changing
-l spa
to-l eng
:tesseract "$TEMPFILE" stdout -l eng | xclip -selection clipboard
- Navigate to "System Settings" → "Shortcuts".
- Choose "Custom Shortcuts", click "Edit" → "New" → "Global Shortcut" → "Command/URL".
- Name it "OCR with Flameshot".
- Assign
Meta + Shift + T
as the trigger. - For "Action", input /home/your_username/.ocr/flameshot_ocr.sh.
- Access "Settings" → "Keyboard" → "Application Shortcuts".
- Click "Add" and input /home/your_username/.ocr/flameshot_ocr.sh.
- Assign
Meta + Shift + T
when prompted.
- Go to "Settings" → "Keyboard/Keyboard Shortcuts".
- Click "+" to add a new shortcut.
- Set "Name" to "OCR with Flameshot", "Command" to /home/your_username/.ocr/flameshot_ocr.sh.
- Assign the shortcut
Meta + Shift + T
.