{"id":19144030,"url":"https://github.com/sourlemonjuice/ocr-screenshot","last_synced_at":"2026-04-19T01:01:51.580Z","repository":{"id":219489727,"uuid":"746796068","full_name":"SourLemonJuice/OCR-screenshot","owner":"SourLemonJuice","description":"OCR text after screenshot in KDE Plasma using bash script with translation support","archived":false,"fork":false,"pushed_at":"2024-08-09T05:06:41.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T15:45:51.740Z","etag":null,"topics":["kde-plasma","linux","ocr","script","shell","translate"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SourLemonJuice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-22T17:33:22.000Z","updated_at":"2024-08-09T05:10:11.000Z","dependencies_parsed_at":"2024-01-27T21:22:27.668Z","dependency_job_id":"50291467-f398-4b9f-822a-a8d064b69560","html_url":"https://github.com/SourLemonJuice/OCR-screenshot","commit_stats":null,"previous_names":["sourlemonjuice/ocr-screenshot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourLemonJuice%2FOCR-screenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourLemonJuice%2FOCR-screenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourLemonJuice%2FOCR-screenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourLemonJuice%2FOCR-screenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SourLemonJuice","download_url":"https://codeload.github.com/SourLemonJuice/OCR-screenshot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240224953,"owners_count":19767832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kde-plasma","linux","ocr","script","shell","translate"],"created_at":"2024-11-09T07:33:20.015Z","updated_at":"2026-04-19T01:01:51.295Z","avatar_url":"https://github.com/SourLemonJuice.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OCR-screenshot\n\n## 1.简介与基本使用\n\n一个用来快速翻译屏幕上文字的 bash 脚本\n\n### 使用通知模式 (Notification)\n\n- 调用 `spectacle` 截图\n- `tesseract` OCR识别，并发出带控件的通知\n\n可用控件有这些\n\n- 复制: 尽可能复制文本到剪贴板\n- 在终端显示: 打开新的 `konsole` 并用 `less` 显示译文\n- 翻译: 用`Translate Shell`翻译，并通知(可以复制译文)\n  - 复制: 复制译文\n  - 在终端显示: 打开新的 `konsole` 并用 `less` 显示译文\n\n绑定快捷键时可以直接选择 `.sh` 脚本文件\\\n当然 `Result_Mode` 还是需要被配置成 Notification 的（默认）\n\n如果需要使用别的终端模拟器打开消息需要修改 `openTerminalViewer` 函数\n\n### 使用终端模式 (Terminal)\n\n既然是截屏翻译，那在截屏之前显示个终端出来挡着是不是有点傻...\\\n但反正有这个模式嘛\n\n基本就是用 `less` 与 `gum` 重新实现的通知模式\n\n拥有更大的文字展示空间以及美观询问界面\n\n可以用 `OCRscreenshot-Terminal.desktop` 作为快捷键的目标，或者能让它在终端里运行就可以\\\n注意记得更改 `Exec=` 条目的**绝对路径**，desktop 文件只能用绝对路径嘛\n\n同样的 `Result_Mode` 需要被配置成 Terminal\n\n总之建议不要用，只是想留下来而已啦。通知模式是可以在调用终端显示内容的\n\n## 依赖项目列表\n\n这就是全部的依赖项了\\\n这是 Archlinux 软件包名列表:\n\n- spectacle\n- tesseract\n- wl-clipboard (wayland)\n- xclip (x11)\n- translate-shell\n- less\n- gum (terminal mode Only)\n\n## 2.一些重要配置\n\n### 2.1.Tesseract\n\n```bash\n# Tesseract 设置\n# 语言\n_Tesseract_Lang=\"eng+chi_sim\"\n# 配置文件:\n# 消除中文空格\n_Tesseract_Configs+=\"-c preserve_interword_spaces=1\"\n```\n\n### 2.2.Translate Shell\n\n```bash\n# Translate Shell 设置\n# 语言\n_Translate_Shell_Lang=\"zh\"\n```\n\n### 2.3.主程序设置\n\n```bash\n# 结果输出模式\nResult_Mode=\"Notification\"\n```\n\n## --.碎碎念\n\n当我还在windows的时候`有道翻译`几乎一直都在后台的程序，虽然这东西丑爆了但截图翻译确实好用（网易是没有正经美术吗）\\\n当当当当，来到linux下遇到不能复制的gui显示了看不懂的英文就抓瞎啦，耶！（讽刺）\n\n总之写了个小东西玩，平时用的也挺频繁的，虽说大多数时间都是高强度看网页233\n\n~~shell脚本好神奇，我一定要去学编程语言了，aaa~~\\\n脚本语言呀，哈哈。我对他们总是有些奇怪的情感，好用但也不好用，没法做太认真的逻辑呢。\\\n但这些非准确性也让 shell 脚本成为了简单操纵编译语言的得力助手呀。万物都有两面性，在合适的时候选择合适的技术吧。\n\n诶 python 吗？提它干吗，一个脚本语言还要安装依赖还能安出一堆毛病？\\\n233我是真的好想黑 py 的说。\n\n## License\n\nPublished under `MIT` license now, before is `Unlicense`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourlemonjuice%2Focr-screenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourlemonjuice%2Focr-screenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourlemonjuice%2Focr-screenshot/lists"}