TRex - Text Recognition for Arch Linux
Lightning-fast OCR and QR code reader for Wayland/Hyprland on Arch Linux. Select screen area → Extract text or decode QR → Copy to clipboard.
Features
- 🎯 Simple - One command to capture and extract text
- ⚡ Lightning Fast - Tesseract by default, results in under 0.5s
- 🖥️ Wayland Native - Built for modern Linux desktops
- 📋 Clipboard Integration - Automatically copies extracted text
- 🎨 Flexible - Fast mode by default, --accurate flag for complex text
- 🔗 URL Detection - Automatically detect and open URLs in extracted text
- 📱 QR Code Detection - Decode QR codes automatically
Installation
# Install system dependencies (Arch Linux)
sudo pacman -S grim slurp wl-clipboard tesseract tesseract-data-eng zbar
# Install TRex
pip install trex-ocr
TRex includes both text OCR (using Tesseract by default) and QR code reading out of the box.
Usage
# Default: Select area → OCR → Copy to clipboard
trex
# OCR image from clipboard
trex -c
# OCR image file
trex -f screenshot.png
# Output to stdout instead of clipboard
trex -o stdout
# Use different language (e.g., German)
trex -l deu
# Use accurate mode for complex/handwritten text
trex --accurate
# Automatically open detected URLs in browser
trex --open-urls
# QR code mode - decode QR codes, fallback to OCR if none found
trex --qr
# Decode QR code and open if it's a URL
trex --qr --open-urls
Performance
- Default mode: ~0.3-0.5s (Tesseract)
- Accurate mode: ~2-3s (EasyOCR, downloads AI models on first use)
Languages
Tesseract (default): Uses standard 3-letter codes
eng- English (default)deu- Germanfra- Frenchspa- Spanishjpn- Japanese- Install more:
sudo pacman -S tesseract-data-[lang]
EasyOCR (--accurate mode):
en,de,fr,es,ja,ko,ch_sim, etc.- Full list: https://github.com/JaidedAI/EasyOCR#supported-languages
Configuration
Optional config file at ~/.config/trex/config.json:
{
"language": "en",
"gpu": false,
"open_urls": false,
"qr_mode": false
}
- Set
"gpu": trueif you have NVIDIA GPU with CUDA support - Set
"open_urls": trueto automatically open detected URLs by default - Set
"qr_mode": trueto use QR code mode by default
Requirements
- Arch Linux
- Wayland compositor (tested on Hyprland)
- Python 3.8+
- CUDA (optional, for GPU acceleration)
Accurate Mode Setup
For complex images, handwriting, or multiple languages:
# Install accurate mode dependencies
pip install trex-ocr[accurate] --extra-index-url https://download.pytorch.org/whl/cpu
# Or with GPU support (NVIDIA CUDA)
pip install trex-ocr[accurate,gpu]
Then use trex --accurate for better accuracy at the cost of speed.
License
MIT
Metadata
Release files for trex-ocr 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| trex_ocr-1.1.0.tar.gz | 16.5 kB | Without provenance | Details for trex_ocr-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| trex_ocr-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for trex_ocr-1.1.0-py3-none-any.whl |
Total release size: 33.1 kB
Release files / trex_ocr-1.1.0.tar.gz
| Download URL | trex_ocr-1.1.0.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
380e5a3b1234c146c4ee3dc550a7fa10bf51e41e6f30f0e90669a2def28edfb8
|
|
BLAKE2b-256 checksum How to use checksums |
2925bfb083cb03ad23410e5e7ab9abf908f000120d233e7dc7fd4a3fbcf45aec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / trex_ocr-1.1.0-py3-none-any.whl
| Download URL | trex_ocr-1.1.0-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de3afad18013b14a46f853961b805da3dd8ec0c737365badcfa87e792d5e369d
|
|
BLAKE2b-256 checksum How to use checksums |
0e2c53c72b0e119410fe02a79fd06cc8564c9ad4ce40902152ef4a3b9dad4665
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for trex-ocr 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.