This tool gives users the ability to take a screenshot and copy to the clipboard the text content of the screenshot. Works on Windows, macOS, Ubuntu, Manjaro, and (should work on) most other Linux distros.
Running textshot.py
will open an overlay over the screen, where a rectangle can be drawn over the portion of the screen containing the text the user wishes to copy.
An optional command line argument can specify the language. For example, python textshot.py eng+fra
will use English as the primary language and French as the secondary language. The default is eng
(English). Make sure that the appropriate data files for Tesseract are installed for other languages.
It is recommended to attach a global hotkey to this tool.
On Windows, one can accomplish this by using an AutoHotkey script; textshot.ahk
contains a sample AHK script that can be used.
On Ubuntu, open the Keyboard Settings, which shows you all the Gnome shortcuts. At the bottom there is a +
button to add your own shortcuts. Click it and set the command to /usr/bin/python3 <path-to-textshot.py>
. In case you are using a venv, the python3 path above should point to the venv's python3 instead of the global python3.
cd
into itpython -m venv .venv
pip install -r requirements.txt
tesseract
can be reached from the command line by adding the directory to your system path.@rigred has added this to the AUR, so Arch Linux users can install the package textshot-git
with their AUR helper. For example, yay -S textshot-git
.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。