-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Duplicate keys in space_windows_change INFO #498
Comments
I think thats an oversight I made while implementing this event. I think the fix should be option A you have mentioned to sum together apps with the same name but different pid because I don't want to do breaking changes if not badly neccessary. More info about windows is always available if needed when querying the window manager for info (e.g yabai). Off topic: You can configure Alacritty to only use one process to handle all windows. This will be faster because you save the overhead of having separate processes. |
Thanks, I updated my plugin and everything works as expected. |
I think JSON is very easy to work with when using |
Hi Felix!
Thanks for this project. For me coming from more than 10 years of Linux with i3 this is a true lifesaver in getting some of the beloved features to my new mac.
While customizing sketchybar to my needs I discovered that the event "space_windows_change" produces somewhat invalid JSON for me.
These are printouts of the $INFO payload received from the event:
It seems that it does not detect Alacritty as being the same application but detects them as individual applications. Which in itself is not actually a bad thing, my dock is behaving in a similar manner resulting in multiple icons of the same application.
The problem however is when I parse this string with
jq
it will rightfully remove all duplicate keys from the set and I end up with wrong information.I had a look at your code to find the root of this JSON and traced it back to this part:
SketchyBar/src/app_windows.c
Line 135 in 7d121d5
This kinda explains the behaviour, but leaves me quesitoning on how to solve it.
I have two thoughts:
A: fixing the count detection
to retain compatibility with existing setups fixing the count detection so duplicat keys are summed up would be one approach
B: changing the format
While looking at your code i asked myself if you wouldn't want to change the format in something more robust and potentially expandable with more metadata for future uses. For example having a window_id as key in the set or switching to an ordinary list of objects containing arbitrary data.
Let me know what you think. Cheers.
The text was updated successfully, but these errors were encountered: