-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat: sway service #246
feat: sway service #246
Conversation
3e39670
to
ebe8ce0
Compare
@Aylur I think maybe we could have a |
A unified service that would automatically pick up the compositor sounds awesome, but I am not sure how extensive that could be as I am not familiar with the Sway IPC, and I assume there is no standard way to implement it, so later on if we support more compositors there could be some complications. |
30347ef
to
d676774
Compare
@ozwaldorf How ready do you think this PR is? I thought I would set up Sway just to test it and play around with it, but I changed my mind, I don't really care for Sway. So I will just trust you that this is tested and the best solution for managing the sway socket. |
@Aylur currently there's one outstanding bug in keeping The basic information needed to implement workspace indicators are working fine though, specifically the |
There was a similar issue in the Hyprland one. There were race conditions based on what signal the user connected to, I solved it by moving the signals from the Active objects, to the event handler callback. |
a0eb6b2
to
09f0fac
Compare
can i help push this along at all? i have a bit of expy with sway IPC |
I haven't payed much attention to this PR as I got kind of busy |
No worries very happy to test! Will report back when I've done so. Aside: Brand new to this project and thanks for your work, I was looking at doing something similar with a gtk - js node bindings but it was super wonky. |
question regarding functionality before I can call this out as a bug or not (and/or take a swing at fixing) if i have workspaces would you expect that to be managed by the service itself, or the consuming (config) code to order correctly? edit: yeah its a bug, when i add a window to the workspace it jumps back to the correct order. I'll look into it, I feel like I ran into something similar on https://github.com/dlasky/away-bar |
Sorry I haven't had much time to spend on this pr, but hopefully will be able to take a look at the outstanding refactor needed on the socket handling and event triggers.
I suppose this is a bug, although I guess it was unclear on the requirement for ordering of the data in the service. Doing a solution where you create a static number of workspaces and dynamically show or hide them if they exist in the data doesn't do things out of order, as demonstrated in the example widget. The biggest issue atm is that on any workspace but the first, there's a race condition where events are fired before all the previous tree data is repopulated, as outlined #246 (comment) But a simpler explanation of what happens is:
|
yeah i wasn't sure either on this. FWIW an easy way to do it based on my hacking around on this is just dump the workspaces array directly to your service. This has the side effect of ignoring the bag of holding workspace though which may or may not be a good thing depending on your use cases (for me its ideal).
ah, that wasn't really what I was experiencing, but I understand the issue I think. The way I did a 'per workspace set of clients' in away-bar was effectively having a map of clientId's per workspace and pulling the tree (as you are doing) on changes. The issue you are describing though is likely caused by emitting on line 378. you could change the structure of the _handleTreeMessage so that it actually returns a list of changed entity types, and do the emit after the recursive walk is completed:
depending on how fancy you want to get you could check the maps as well, but diffing might be overly expensive there. |
Yeah this is the initial solution i was thinking of, it makes sense.
Yeah, the most perfect solution would be to do deep object comparison and build a list of change events and fire at once at the end, but I agree this can get really expensive and wouldn't scale for a user with a very complex nested session |
Is there any way this could also support keyboard layouts? Sway can set |
If you would continue this work on https://github.com/aylur/astal, that would be appreciated |
Adds a sway service with usage similar to the hyprland service
consider unifying active typesexaminegetWorkspace(id)
usage, sway usesworkspace.name
(ids are random), hyprland usesworkspace.id
(ids are fixed)explore unified workspace serviceExample