Fix Hyprland workspace handling: ignore special workspaces#47
Open
EdwinLeeford wants to merge 1 commit into
Open
Fix Hyprland workspace handling: ignore special workspaces#47EdwinLeeford wants to merge 1 commit into
EdwinLeeford wants to merge 1 commit into
Conversation
Computerdores
left a comment
There was a problem hiding this comment.
As far as special workspaces go this works perfectly!
However, Hyprland also supports named workspaces which have negative IDs as well. This leads to them also being ignored under this PR. However, because they behave like regular workspaces they should, imo, not be ignored.
Since the name of special workspaces always starts with special:, we can instead filter on that (see my suggested change).
| self.workspaces | ||
| .iter() | ||
| .filter(|ws| ws.monitor == output.name) | ||
| .filter(|ws| ws.monitor == output.name && ws.id >= 0) |
There was a problem hiding this comment.
Suggested change
| .filter(|ws| ws.monitor == output.name && ws.id >= 0) | |
| .filter(|ws| ws.monitor == output.name && !ws.name.starts_with("special:")) |
(One minor issue: Hyprland allows the names of named workspaces to start with special: so these will still be filtered out. However, Hyprland does not expose the information whether a workspace is special in any other manner, so I don't think there is an alternative here)
Atemu
added a commit
to Atemu/i3bar-river
that referenced
this pull request
Jul 23, 2025
Hyprland's special workspaces have negative indices which would cause i3bar-river to irrecoverably display an error. I built this before I looked whether someone else already did this and found MaxVerevkin#47. I think I like not filtering out workspaces at all to be the better option because this way the special workspace is shown in front of the other workspaces but only when it's activated which I find quite intuitive; it's special afterall. This behaviour is infinitely better than irrecoverably soft-crashing either way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A simple patch that resolves the Issue #46 in the Hyprland workspace module when special workspaces, which use negative IDs are present.
u32toi32for workspace IDs across all WM backends