Skip to content
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

Hyprland/workspaces: add feature for hiding persistent workspaces that lie past furthest active/non-empty workspace #2617

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rehanzo
Copy link
Contributor

@rehanzo rehanzo commented Oct 29, 2023

Hard to really describe, so I've included a video to demonstrate. I have workspaces 1-10 both setup as persistent and for pruning.

output.mp4

Basically, you can specify persistent workspaces that become hidden if they lie past the furthest workspace on the bar, besides special workspaces, that is active or non-empty. This allows for having a bar such as mine that isn't numbered, but still lets me know what number any given workspace is, without having to display all workspaces.

With regards to the implementation, I'm not sure if I've really done it the most efficient way, so a look over by someone more experienced would be appreciated. I have a loop that loops through the workspaces from the end to the beginning to find the furthest workspace that is active/non-empty, but I feel there's surely a better way to implement that.

It currently only works on update, and not on startup. To temporarily remedy this, I have called update on init, but I plan to get it working properly on startup. I've had a quick go at it and couldn't seem to get it down, so ideas on that would be appreciated.

Lastly, not entirely sure how the configuration should go in terms of naming and actual values. The way its set up now, prune-past-persistence-point lets you specify workspace IDs that are already set as persistent to be pruned if past the furthest active/non-empty workspace. I also added another config option, exclude-persistence-point, that allow you to specify workspace IDs that will be ignored when determining the furthest active/non-empty workspace. I use this specifically to have workspace ID 21 for music with a seperate icon. Since it has a seperate icon, I don't need to see all the prior workspaces, because I know the workspace with the music icon is workspace ID 21. Not sure if this is the best way to go about it however, so any ideas with this are also welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant