Skip to content

Toni500github/oshot

Repository files navigation

oshot

A simple and lightweight tool for extracting and translating text from a screenshot (on the fly)

Dependencies

Linux

Package names may vary by distribution and package manager.
If a package is not found, try searching by its base name (e.g., libglfw3-devglfw).

  • libx11-dev
  • grim (Wayland only)
  • libglfw3-dev
  • tesseract (including necessary language models)
  • Python and pip
    • Python packages:
      pip install pillow pystray pyclip pyperclipimg

Windows

  1. Install Python from the Microsoft Store or python.org.
    Note: Make sure to check the "Add Python to PATH" option during installation.

  2. Install pip by running the following commands in CMD:

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
    python get-pip.py
  3. Install Python packages:

    pip install pillow pystray pyclip pyperclipimg
  4. Download the required language data for Tesseract from tessdata.

  5. Extract the language files to a directory of your choice.

  6. Configure the Tesseract and language data paths in the config.toml file (see Windows Configuration section for more details).

Building

Make

$ git clone https://github.com/Toni500github/oshot/
$ cd oshot/
$ make
# You can move it in a custom directory in your $PATH (preferably in the home)
$ ./build/release/oshot

CMake (ninja)

$ git clone https://github.com/Toni500github/oshot/
$ cd oshot/
$ mkdir build2 && cd build2
$ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
$ ninja
# You can move it in a custom directory in your $PATH (preferably in home)
$ ./oshot

Windows Configuration

After installing Tesseract:

  1. Open the %APPDATA% directory (press Win+R and type %APPDATA%)
  2. Navigate to the oshot directory
  3. Edit config.toml and set the ocr-path variable to your Tesseract data directory
    • Use double backslashes in the path: C:\\Users\\Name\\tessdata Example:
ocr-path = "C:\\Program Files\\Tesseract-OCR\\tessdata"

Troubleshooting

Windows

If when starting oshot, it starts to flick the screen black (or it won't launch), try to follow these steps:

  1. Download MesaForWindows-x64-20.1.8.7z
  2. Extract the opengl32.dll file into the directory where oshot.exe is located
  3. Try to launch it again

Linux

If when you try to run ./oshot, it gives an error about not finding liblept.so.5, then try to follow these steps:

  1. Make sure tesseract and leptonica are both installed
  2. Run this command as root: ln -s /usr/lib/libleptonica.so /usr/lib/liblept.so.5
  3. Try to launch it again

If still errors, please open an Issue and take a screenshot of the error appearing in the console when executing oshot.exe

Usage

simplescreenrecorder-2025-12-29_20.35.53.mp4

About

Screenshot tool to extract (OCR) and translate text on the fly

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages