Skip to content

tuberry/light-dict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

146 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Light Dict

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
license

ld

Installation

Manual

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/local

For 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:

E.G.O

Get it on GNOME Extensions

Features

DBus

For the DBus usage, refer to _ldocr.sh.

Methods

gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/LightDict
  • The Get method is private for the built-in OCR script.

Arguments

OCR
  • args: a string (temporary OCR arguments)
Run
  • type: 'auto' (follow the trigger) | '^swift(:.+)?$' | 'popup' | 'print' (directly show the following text & 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

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.

Dependencies

Screencast

peek-light-dict-ocr.mp4

Notes

  • 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.

Contributions

Feel free to open an issue or PR in the repo for any question or idea.

Translations

To initialize or update the po file from sources:

bash ./cli/update-po.sh [your_lang_code] # like zh_CN, default to $LANG

Developments

To install GJS TypeScript type definitions:

npm install @girs/gnome-shell --save-dev

Acknowledgements

About

GNOME Shell extension to manipulate primary selections on the fly, typically used as Lightweight Dictionaries

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors