GNOME Shell extension to manipulate primary selections on the fly, typically used as Lightweight Dictionaries.
L, you know what? The Shinigami only eats apples. —— Light Yagami
The latest and supported version should only work on the current stable version of GNOME Shell.
git clone https://github.com/tuberry/light-dict.git && cd light-dict
meson setup build && meson install -C build
# meson setup build -Dtarget=system && meson install -C build # system-wide, default --prefix=/usr/localFor older versions, it's recommended to install via:
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell \
--method org.gnome.Shell.Extensions.InstallRemoteExtension 'light-dict@tuberry.github.io'It's quite the same as installing from:
For the DBus usage, refer to _ldocr.sh.
gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/LightDict- The
Getmethod is private for the built-in OCR script.
- args:
a string(temporary OCR arguments)
- type:
'auto'(follow the trigger) |'^swift(:.+)?$'|'popup'|'print'(directly show the followingtext&info) - text:
a string|''(for primary selection) - info:
a string(for the'print'type) |''(for the other types) - area:
[](default to the cursor) |[x, y, width, height](the source area)
OCR here is subject to factors such as fonts, colors, and backgrounds, which says any unexpected results are expected, but usually the simpler the scenes the better the results.
peek-light-dict-ocr.mp4
- By lightweight, I mean that it doesn't come with any dictionary sources. :)
- For English-Chinese offline dictionaries, try dict-ecdict or dict-cedict.
- To customize appearances of some widgets, try user-theme-x.
Feel free to open an issue or PR in the repo for any question or idea.
To initialize or update the po file from sources:
bash ./cli/update-po.sh [your_lang_code] # like zh_CN, default to $LANGTo install GJS TypeScript type definitions:
npm install @girs/gnome-shell --save-dev- youdaodict: the idea of panel
- swift-selection-search: the stylesheet of popup
- capture2text: the idea of bubble OCR (dialog OCR here)
