Repository navigation
Tutorial: How to invoke GoldenDict translation using a global shortcut on KDE Plasma 6 Wayland #3110
wpdevelopment11
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
Install the wl-clipboard package if it's not already installed.
On Ubuntu the command is as follows:
Create a Script That Will Be Invoked by the Global Shortcut
Create a file
~/goldendict_global_shortcut.shwith the following content:If you are using Flatpak version
If you are using the package from your distro
Set the executable bit:
chmod +x ~/goldendict_global_shortcut.shCreate the Global Shortcut for GoldenDict
Once you invoke the shortcut your selection or clipboard, if there is no active selection will be send to GoldenDict. In the video I set it to
Meta+Spacebut you can choose whatever you want.Make sure to paste the path of the script created previously. In my case it is
~/goldendict_global_shortcut.sh.shortcut.webm
Disable Focus Stealing Prevention
This is optional. But without it GoldenDict will not be able to show itself on top of other windows reliably when you invoke the shortcut.
This works only for KDE Plasma 6.5 and newer.
Open the GoldenDict window alongside the KDE System Settings. The GoldenDict window is needed to catch its Window class.
See the recording below for how to create a Window Rule to disable Focus stealing prevention only for GoldenDict windows.
focus_stealing.webm
The Final Result
You should be able to invoke GoldenDict dictionary lookup using your created shortcut and it will appear on top of other windows.
final.webm
Tip: If You Are Using the Flatpak Version
Run the following command, which will allow you to run GoldenDict natively on Wayland:
All reactions