Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Feature to remove/destroy persistent workspaces

Open dann-merlin opened this issue 1 year ago • 1 comments

Description

My workflow involves creating a number of persistent workspaces for each monitor. Whenever I disconnect a monitor, I would like to remove those workspaces again. This appears to be impossible at the moment.

The way to do this I have in mind is just a simple dispatcher to destroy a workspace. Alternatively, it might also be a possibility to change the "persistent" property of a workspace after the initial setup. I tried this too, but it did not seem to do anything for now.

dann-merlin avatar Jun 06 '24 01:06 dann-merlin

hi, I just added the feature to refresh workspace persistance after renaming a workspace. so if your workspace was made persistent by a workspace rule with name selector, and you rename it, it well become non persistent.

hariseldon78 avatar Feb 15 '25 23:02 hariseldon78

Hey, that's nice to hear! I could not get it working though. Do you have an example of how to create and remove a persistent workspace? I tried this:

hyprctl keyword workspace 3,monitor:DP-2,persistent:true
# and then to remove:
hyprctl keyword workspace 3,monitor:DP-2,persistent:false

dann-merlin avatar Feb 23 '25 01:02 dann-merlin

Unfortunately workspace rules cannot be updated/deleted yet; that is also something I'd like to try and implement. I was referring to the renaming of the workspace itself, like this:

hyprctl keyword "workspace=n[s:a], persistent:true"
hyprctl dispatch workspace "name:abc" # suppose the workspace id is -1337
hyprctl dispatch renameworkspace -1337 def # rename it to "def" -> not matching the rule anymore

You see, the rule refer to the workspace by its name (the start of it actually), so when it's not matching anymore the workspace becomes non persistent, and if it's empty it will be removed.

hariseldon78 avatar Feb 24 '25 08:02 hariseldon78

Hello there!

This issue has been closed, as we are moving from issues to discussions. More about this can be found here and in #9854.

Firstly, please make sure this issue is still relevant in latest Hyprland. If so, we ask you to open a discussion (please read the discussion guidelines first, in the pinned post)

Thank you for your understanding!

vaxerski avatar Apr 05 '25 19:04 vaxerski