migaku-official / Migaku-Dictionary-Addon

Migaku Dictionary allows users to lookup word definitions, export definitions to their cards in real-time, hear word audio and see word frequency, etc. If you have an issue please report it in the "Issues" tab. Reponses to issues can be slow on GitHub, for faster support consider joining our Discord server through our Patreon page.
GNU General Public License v3.0
64 stars 24 forks source link

Global hotkeys (problems) #40

Closed avc1657 closed 3 years ago

avc1657 commented 4 years ago

Type:

Environment:

I'm going to open a PR to resolve the issue:

Description: Global hotkeys like Ctrl+C+Space are not working, but inside anki hotkeys are ok (Ctrl+S and +W). For example, when I press Ctrl+C+Space to search for currently highlighted text in my browser the following error appears (is there any way to fix it?):

Caught exception: Traceback (most recent call last): File "/home/arthurvc/.local/share/Anki2/addons21/1655992655/main.py", line 462, in captureKey mw.hkThread.handleSystemSearch() File "/home/arthurvc/.local/share/Anki2/addons21/1655992655/midict.py", line 726, in handleSystemSearch self.search.emit(Pyperclip.paste()) File "/home/arthurvc/.local/share/Anki2/addons21/1655992655/Pyperclip.py", line 287, in paste_klipper assert len(clipboardContents) > 0 AssertionError

edulim commented 4 years ago

I don't use KDE or Klipper, so I'm gonna try to help you as an ordinary Linux user.

Apparently, Pyperclip has a workaround for a Klipper bug, and that workaround is causing that Error. I think a solution using Klipper and Pyperclip at their current state would be too complicated, so my recommendation is that you install xclip, because Pyperclip should default to it, and ignore Klipper. xclip is a small command line program, that should work just fine, based on my experience.

avc1657 commented 4 years ago

I'm new to Linux, dual booting with Windows 10. I installed Manjaro in a Virtual Machine just for testing and global hotkeys work properly. But when i update the system, it wont work anymore. I also tried a fresh installation outside a VM, same results, after update global hotkeys wont work. I'll try to install xclip as you said. Thank you.

Edit: fixed. Edulim, thank you very much!!!

KieranBrannigan commented 3 years ago

Thank you for supporting Migaku.

We have closed this issue since this it is >6 months old; if you feel that this issue is still a problem in the latest version, please comment below and we will reopen and begin investigating this issue.

We apologise that recently we didn't have the manpower to maintain these repos properly, but we aim to maintain them better from here on out.