-
-
Notifications
You must be signed in to change notification settings - Fork 968
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
Persistent workspaces #3346
Persistent workspaces #3346
Conversation
a) why? |
it would also be very handy to be able to specify the workspace flags at workspace creation, if any of the mantainers have a suggestion about the desired syntax I'll implement it in the workspace dispatcher.
|
nuh uh, allfloat is deprecated we dont do that |
Briefly my workflow that makes use of named persistent workspaces, is like this: i work on differrent projects, for different clients, so i keep a bunch of workspaces for each client named with an abbreviation of the project, for example bb1 bb2 bb3 hl1 hl2 hl3. With keybindings i can quickly navigate to a workspace and open a terminal or an editor, and a couple of scripts will open them directly in the project folder. I find it useful!
i can remove them if you say, but maybe people are using them..
That's true, my reasoning was that the flags were already not printed, so maybe the intention was to keep the non-json output compact, and use the json output as a programmatic interface to be queried in scripts and automation. I'll add them to the non-json part |
ok, the point is to specify flags, not which flags... I'll make a separate PR to remove allfloat and allpseudo |
There it is, I removed the allfloat and allpseudo from output and added the persistent flag to the non-json format. |
Could this solve more properly the persistent workspaces that is currently "faked" in waybar? Looks like the final step to fix #658 |
@hariseldon78 what is your current way of creating workspaces and setting them to persistent? Ideally I'd like to create them all on startup and then just move them around on monitors. |
@Diaoul in my hyprland.conf i bound this script: https://gist.github.com/hariseldon78/2fb20d04036cad8969152f379d9b70f5 The relevant part is from line 23 to 29: If you create them at boot then it's easier, no need to query because by default the persistent flag is off. Feel free to use my fork to try it out, i also created an arch aur package for the time being: https://aur.archlinux.org/packages/hyprland-persistent-workspaces-git I think the best approach, if the main dev doesn't agree to merge this, is to make it a plugin, but work is a taking more and more time and I still couldn't manage to do it. But I'll try to update my fork more frequently if i know that somebody is using it... |
Thanks, I'm using the fork now ant it's working as expected. This could be a nice addition for those who wanted persistent workspaces. I tried the waybar persistent workspace feature but for some reason it creates additional ones and I end up having the same workspace number present on different monitors 😕 I see that all the review comments have been addressed. What do you think about merging this now @vaxerski? Even if it's not the best way to implement this, it works for a minimal footprint in the code, that's something. |
@@ -1358,6 +1358,8 @@ void CKeybindManager::workspaceOpt(std::string args) { | |||
} | |||
} | |||
} | |||
} else if (args == "persistent") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workspaceopt is horrible, and on track to be deleted. I'd rather this was a workspace rule.
See CConfigManager::handleWorkspaceRules
for handling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could work only if we are able to add/remove those rules at runtime, not only at config time.
I can try and code a couple of dispatchers, something like "addworkspacerule" and "removeworkspacerule".
Would that be ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hariseldon78 can't you do it at runtime already with hyprctl keyword workspace
?
e.g.
hyprctl keyword workspace "1, monitor:eDP-1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that's perfect then, I'll do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe your PR, what does it fix/add?
It allows to mark a workspace as persistent, inhibiting removal during the sanity check
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
The work was already done with the
m_bIndestructible
flag, I just fixed a little bug the handling in the sanity check loop.Also I added the
persistent
keyword to theworkspaceopt
dispatcher and the output of workspace flags to thehyprctl workspaces -j
commandIs it ready for merging, or does it need work?
It's working, i tested it on my system in a nested window, gonna test install it as system package in the next minutes.