2026-04-03 09:42:24
Since currently the pop-up window functionality of GoldenDict-ng is kind of bugged on KDE, this script might help.
You'll need kdotool and wl-clipboard. Add the script to the KDE menu and set a global keyboard shortcut. The shortcut will also work if the clipboard is empty (just showing GoldenDict).
#GoldenDict
![#!/bin/bash
WINDOW_ID=$(kdotool search --name "GoldenDict-ng")
ACTIVE_ID=$(kdotool getactivewindow)
if [ "$WINDOW_ID" == "$ACTIVE_ID" ]; then
# Window is active and on top
kdotool -q search --name "GoldenDict-ng" windowclose
else
# Window is either hidden, minimized, or in the background
goldendict "$(wl-paste --primary)" # will grab the whole selection; remove quotes for the first word only
kdotool -q search --name "GoldenDict-ng" windowactivate
fi
exit 0](https://cdn.masto.host/socialpetertoushkoveu/media_attachments/files/116/340/088/967/083/421/small/7a32486afec916dc.jpg)