Lightweight extension for on-the-fly manipulation to primary selections, especially optimized for Dictionary lookups.
L, you know what? The Shinigami only eats apples. —— Light Yagami\
The latest and supported version should only work on the most 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:
For the DBus usage, see _ldocr.fish as a sample reference.
gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell/Extensions/LightDict
a string
(temporary parameters for OCR)'^swift(:.+)?$'
| 'popup'
| 'display'
(fallback) | 'auto'
(follow the trigger)a string
| ''
(for primary selection)a string
(for the 'display'
type) | ''
(for the other types)[x, y, width, height]
(the source area) | []
(default to the cursor)Scripts run within bash -c
:
$LDWORD
to get the captured text (by primary selection or OCR);$LDAPPID
to get the focused app (most likely where the text from);Scripts run within scoped JS eval()
to provide DE related functions:
LDWORD
: the captured text;LDAPPID
: the focused app;open('uri')
: open uri with default app;copy(LDWORD)
: copy LDWORD
to clipboard;search(LDWORD)
: search LDWORD
in Overview;key('super+a')
: simulate keyboard input;And some native JS functions like LDWORD.toUpperCase()
.
Feel free to open an issue or PR in the repo for any question or idea.
To update the po file from sources:
bash ./cli/update-po.sh [your_lang_code] # like zh_CN, default to $LANG
To install GJS TypeScript type definitions:
npm install @girs/gnome-shell --save-dev