# TRex - Text Recognition for Arch Linux
[](https://badge.fury.io/py/trex-ocr)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/amebalabs/trex-ocr)
[](https://www.linux.org/)
[](https://archlinux.org/)
[](https://wayland.freedesktop.org/)
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
[](https://pypi.org/project/trex-ocr/)
[](https://pypi.org/project/trex-ocr/)
```bash
# 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
```bash
# 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` - German
- `fra` - French
- `spa` - Spanish
- `jpn` - 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`:
```json
{
"language": "en",
"gpu": false,
"open_urls": false,
"qr_mode": false
}
```
- Set `"gpu": true` if you have NVIDIA GPU with CUDA support
- Set `"open_urls": true` to automatically open detected URLs by default
- Set `"qr_mode": true` to 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:
```bash
# 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
Raw data
{
"_id": null,
"home_page": null,
"name": "trex-ocr",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ocr, tesseract, easyocr, wayland, linux, screenshot, text-recognition, fast-ocr, clipboard, qr-code",
"author": null,
"author_email": "amebalabs <team@amebalabs.com>",
"download_url": "https://files.pythonhosted.org/packages/29/25/bfb083cb03ad23410e5e7ab9abf908f000120d233e7dc7fd4a3fbcf45aec/trex_ocr-1.1.0.tar.gz",
"platform": null,
"description": "# TRex - Text Recognition for Arch Linux\n\n[](https://badge.fury.io/py/trex-ocr)\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n[](https://github.com/amebalabs/trex-ocr)\n[](https://www.linux.org/)\n[](https://archlinux.org/)\n[](https://wayland.freedesktop.org/)\n\nLightning-fast OCR and QR code reader for Wayland/Hyprland on Arch Linux. Select screen area \u2192 Extract text or decode QR \u2192 Copy to clipboard.\n\n## Features\n\n- \ud83c\udfaf **Simple** - One command to capture and extract text\n- \u26a1 **Lightning Fast** - Tesseract by default, results in under 0.5s\n- \ud83d\udda5\ufe0f **Wayland Native** - Built for modern Linux desktops\n- \ud83d\udccb **Clipboard Integration** - Automatically copies extracted text\n- \ud83c\udfa8 **Flexible** - Fast mode by default, --accurate flag for complex text\n- \ud83d\udd17 **URL Detection** - Automatically detect and open URLs in extracted text\n- \ud83d\udcf1 **QR Code Detection** - Decode QR codes automatically\n\n## Installation\n\n[](https://pypi.org/project/trex-ocr/)\n[](https://pypi.org/project/trex-ocr/)\n\n```bash\n# Install system dependencies (Arch Linux)\nsudo pacman -S grim slurp wl-clipboard tesseract tesseract-data-eng zbar\n\n# Install TRex\npip install trex-ocr\n```\n\nTRex includes both text OCR (using Tesseract by default) and QR code reading out of the box.\n\n## Usage\n\n```bash\n# Default: Select area \u2192 OCR \u2192 Copy to clipboard\ntrex\n\n# OCR image from clipboard\ntrex -c\n\n# OCR image file\ntrex -f screenshot.png\n\n# Output to stdout instead of clipboard\ntrex -o stdout\n\n# Use different language (e.g., German)\ntrex -l deu\n\n# Use accurate mode for complex/handwritten text\ntrex --accurate\n\n# Automatically open detected URLs in browser\ntrex --open-urls\n\n# QR code mode - decode QR codes, fallback to OCR if none found\ntrex --qr\n\n# Decode QR code and open if it's a URL\ntrex --qr --open-urls\n```\n\n## Performance\n\n- **Default mode**: ~0.3-0.5s (Tesseract)\n- **Accurate mode**: ~2-3s (EasyOCR, downloads AI models on first use)\n\n## Languages\n\n**Tesseract (default)**: Uses standard 3-letter codes\n- `eng` - English (default)\n- `deu` - German\n- `fra` - French\n- `spa` - Spanish\n- `jpn` - Japanese\n- Install more: `sudo pacman -S tesseract-data-[lang]`\n\n**EasyOCR (--accurate mode)**:\n- `en`, `de`, `fr`, `es`, `ja`, `ko`, `ch_sim`, etc.\n- Full list: https://github.com/JaidedAI/EasyOCR#supported-languages\n\n## Configuration\n\nOptional config file at `~/.config/trex/config.json`:\n\n```json\n{\n \"language\": \"en\",\n \"gpu\": false,\n \"open_urls\": false,\n \"qr_mode\": false\n}\n```\n\n- Set `\"gpu\": true` if you have NVIDIA GPU with CUDA support\n- Set `\"open_urls\": true` to automatically open detected URLs by default\n- Set `\"qr_mode\": true` to use QR code mode by default\n\n## Requirements\n\n- Arch Linux\n- Wayland compositor (tested on Hyprland)\n- Python 3.8+\n- CUDA (optional, for GPU acceleration)\n\n## Accurate Mode Setup\n\nFor complex images, handwriting, or multiple languages:\n\n```bash\n# Install accurate mode dependencies\npip install trex-ocr[accurate] --extra-index-url https://download.pytorch.org/whl/cpu\n\n# Or with GPU support (NVIDIA CUDA)\npip install trex-ocr[accurate,gpu]\n```\n\nThen use `trex --accurate` for better accuracy at the cost of speed.\n\n\n## License\n\nMIT\n",
"bugtrack_url": null,
"license": null,
"summary": "Lightning-fast OCR and QR code reader for Wayland/Linux. Tesseract by default, with optional AI-powered mode.",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/amebalabs/trex-linux",
"Issues": "https://github.com/amebalabs/trex-linux/issues",
"Repository": "https://github.com/amebalabs/trex-linux"
},
"split_keywords": [
"ocr",
" tesseract",
" easyocr",
" wayland",
" linux",
" screenshot",
" text-recognition",
" fast-ocr",
" clipboard",
" qr-code"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0e2c53c72b0e119410fe02a79fd06cc8564c9ad4ce40902152ef4a3b9dad4665",
"md5": "36ca95da7b90598b506273ce1b65c802",
"sha256": "de3afad18013b14a46f853961b805da3dd8ec0c737365badcfa87e792d5e369d"
},
"downloads": -1,
"filename": "trex_ocr-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "36ca95da7b90598b506273ce1b65c802",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16619,
"upload_time": "2025-07-13T16:22:07",
"upload_time_iso_8601": "2025-07-13T16:22:07.698139Z",
"url": "https://files.pythonhosted.org/packages/0e/2c/53c72b0e119410fe02a79fd06cc8564c9ad4ce40902152ef4a3b9dad4665/trex_ocr-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2925bfb083cb03ad23410e5e7ab9abf908f000120d233e7dc7fd4a3fbcf45aec",
"md5": "5b2f8c24eee12aee9b08d863fb5b3f24",
"sha256": "380e5a3b1234c146c4ee3dc550a7fa10bf51e41e6f30f0e90669a2def28edfb8"
},
"downloads": -1,
"filename": "trex_ocr-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "5b2f8c24eee12aee9b08d863fb5b3f24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16523,
"upload_time": "2025-07-13T16:22:08",
"upload_time_iso_8601": "2025-07-13T16:22:08.585399Z",
"url": "https://files.pythonhosted.org/packages/29/25/bfb083cb03ad23410e5e7ab9abf908f000120d233e7dc7fd4a3fbcf45aec/trex_ocr-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-13 16:22:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "amebalabs",
"github_project": "trex-linux",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "trex-ocr"
}