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

[Enhancement] Add way to explicitly show/hide special workspace (rather than 'toggle') #8594

Open
dxrcy opened this issue Nov 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@dxrcy
Copy link

dxrcy commented Nov 27, 2024

The Problem

The dispatcher togglespecialworkspace has no (documented) way of always-showing, or always-hiding, a workspace. It can only toggle the visibility between shown/hidden.

I am looking for a method with this behaviour:

  • If the given special workspace is hidden, then show it
  • Else do nothing (the given special workspace is already shown)

...and the inversely to hide it.

Possible Solution 1

The dispatcher togglespecialworkspace could take an optional second parameter for the desired action (toggle, show, or hide). I believe this is compatible with the current API.

# Default: `toggle`
hyprctl dispatch togglespecialworkspace magic
hyprctl dispatch togglespecialworkspace magic, toggle
# New behaviour
hyprctl dispatch togglespecialworkspace magic, show
hyprctl dispatch togglespecialworkspace magic, hide

Possible Solution 2

Alternatively, two new dispatchers could be introduced. I would imagine this is less favorable as it increases the amount of dispatchers.

hyprctl dispatch hidespecialworkspace magic
hyprctl dispatch showspecialworkspace magic

Possible Solution 3

Another alternative could be a way to request the visibility state of a specific special workspace. If this is already possible, I could not find a way to do it.

Maybe hyprctl workspaces could list a visible: 0/1 value for special workspaces?

hyprctl workspaces -j | jq '.[] | select(.name == "special:<NAME>") | .visible'
# Prints `0` or `1` (or nothing, if `<NAME>` is not the name of a special workspace)

hyprctl activeworkspace never returns the name of a special workspace, even if a special workspace is active and focused. Is this intended behviour? If not, I will open a new issue for that.

Current Workaround

To hide the current special workspace (and hence hide all special workspaces), the user can show, and immediately hide, a non-existent empty special workspace (named __TEMP here).

hyprctl dispatch togglespecialworkspace __TEMP
hyprctl dispatch togglespecialworkspace __TEMP

To show a special workspace: hide all special workspaces (as shown above), and then toggle the desired workspace.

hyprctl dispatch togglespecialworkspace __TEMP
hyprctl dispatch togglespecialworkspace __TEMP
hyprctl dispatch togglespecialworkspace <NAME>

Related: #6862
Possibly related: #7662

@dxrcy dxrcy added the enhancement New feature or request label Nov 27, 2024
@MightyPlaza
Copy link
Contributor

#6862

@dxrcy
Copy link
Author

dxrcy commented Nov 28, 2024

#6862

I did not see this! Thanks!

I will still keep this issue open until the PR is merged, as it provides alternative solutions and more context.

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

No branches or pull requests

2 participants