A simple and lightweight tool for extracting and translating text from a screenshot (on the fly)
Package names may vary by distribution and package manager.
If a package is not found, try searching by its base name (e.g., libglfw3-dev → glfw).
libx11-devgrim(Wayland only)libglfw3-devtesseract(including necessary language models)- Python and pip
- Python packages:
pip install pillow pystray pyclip pyperclipimg
- Python packages:
-
Install Python from the Microsoft Store or python.org.
Note: Make sure to check the "Add Python to PATH" option during installation. -
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
-
Install Python packages:
pip install pillow pystray pyclip pyperclipimg
-
Download the required language data for Tesseract from tessdata.
-
Extract the language files to a directory of your choice.
-
Configure the Tesseract and language data paths in the
config.tomlfile (see Windows Configuration section for more details).
$ 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$ 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)
$ ./oshotAfter installing Tesseract:
- Open the
%APPDATA%directory (press Win+R and type%APPDATA%) - Navigate to the
oshotdirectory - Edit
config.tomland set theocr-pathvariable to your Tesseract data directory- Use double backslashes in the path:
C:\\Users\\Name\\tessdataExample:
- Use double backslashes in the path:
ocr-path = "C:\\Program Files\\Tesseract-OCR\\tessdata"If when starting oshot, it starts to flick the screen black (or it won't launch), try to follow these steps:
- Download MesaForWindows-x64-20.1.8.7z
- Extract the
opengl32.dllfile into the directory whereoshot.exeis located - Try to launch it again
If when you try to run ./oshot, it gives an error about not finding liblept.so.5, then try to follow these steps:
- Make sure tesseract and leptonica are both installed
- Run this command as root:
ln -s /usr/lib/libleptonica.so /usr/lib/liblept.so.5 - 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