-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotkey doesn't work on MacOS #13
Comments
Hey @avi-cenna did you manage to fix this? I got this issue as well. It works really well on my Windows. But now i'm running to run it on my mac and getting into the hotkeys issue. Nothing I do seems to get it to recognize the keys i set up in config.json. Tried another library as well but to no avail. |
Anyway, I finally got it to work. I didn't completely perform a full process of elimination for the root cause, but after switching the library from I'm currently using Mac OS Sonoma 14.1.2 (23B92), and it seemed that with the original code, Mac OS takes issue with the attempt to create a new window from a thread that is not the main thread. So it seems that In Mac OS, UI-related operations must be performed on the main thread, and this restriction is enforced by the AppKit framework. The error is likely coming from the StatusWindow class, which seems to be using Tkinter (as indicated by the libtk8.6.dylib in the stack trace). Tkinter is not thread-safe, and all Tkinter operations should be done on the main thread. To resolve this issue, you need to ensure that the StatusWindow is created and manipulated only from the main thread. The below is how I have managed to revamp the
|
Thank you @felixlu07 for providing your solution! Would you be willing to open a PR with your changes so others can also use your fix? I just approved PR #10 which moved us to |
I have tried the default hotkey, as well as several custom ones, and whatever I do, nothing pops up when I press the hotkey.
On an unrelated note, this script requires
sudo
on Mac; not sure if there's a way to avoid this.The text was updated successfully, but these errors were encountered: