Light Dict
Lightweight extension for instant action to primary selection, especially optimized for Dictionary lookup.
L, you know what? The Shinigami only eats apples. โโ Light Yagami
Installation
Recommended
Manual
The latest and supported version should only work on the the most current stable version of GNOME Shell.
git clone https://github.com/tuberry/light-dict.git && cd light-dict
make && make install
# make mergepo # for translation
For older versions, it's necessary to switch the git tag before make
:
# git tag # to see available versions
git checkout your_gnome_shell_version
Features
Basic
- Scroll on the iconbar to flip pages;
- Scroll on the systray to toggle triggers;
- Middle click on the panel to copy its content;
DBus
For the DBus usage, see _ldocr.fish as a sample reference.
Methods
gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/LightDict
Arguments
- temp:
a string
(temporary parameters for OCR) - type:
'^swift(:.+)?$'
|'popup'
|'display'
(fallback) |'auto'
(follow the trigger) - text:
a string
|''
(for primary selection) - info:
a string
(for the'display'
type) |''
(for the other types)
OCR
Dependencies
- python-opencv
- python-pytesseract
- python-googletrans: (optional) specify the DEST (e.g.
-d zh-cn
) to enable
yay -S python-opencv python-pytesseract # use the package manager of your distro
Usage
Enable OCR and fill in parameters (click the button for details) as you wish:
Note that OCR here is subject to factors such as font, color, and background, which says that any unexpected results are expected, but usually the simpler the scene the better the results.
Screencast
peek-light-dict-ocr.mp4
Note
- This extension doesn't offer any additional icons or dictionaries.
- If you need English-Chinese offline dictionaries, try dict-ecdict or dict-cedict.
- If you need to customize the appearance of some widgets, try user-theme-x.
Acknowledgements
- youdaodict: the idea of popup
- gsconnect: fake keyboard input
- swift-selection-search: the stylesheet of iconbar