Skip to content

Special behavior for special workspace(hyprland/workspaces) [WIP but works in its basic form lol]#4029

Open
acropolis914 wants to merge 1 commit into
Alexays:masterfrom
acropolis914:hyrland-workspace-minor-add
Open

Special behavior for special workspace(hyprland/workspaces) [WIP but works in its basic form lol]#4029
acropolis914 wants to merge 1 commit into
Alexays:masterfrom
acropolis914:hyrland-workspace-minor-add

Conversation

@acropolis914

@acropolis914 acropolis914 commented Apr 4, 2025

Copy link
Copy Markdown

This should not break anything. Just extended the functionality a bit. So I was tinkering with the workspaces buttons css and I wanted to have a separate active indicator for my special workspace as currently, you can only have one active indicator.

Also, it bothered me a lot that when my special workspace is turned on, the non-special active one is also colored and I want only the special one to be colored

My implementation

  • added a check to see if it is a special and active, if so, find the "special-active" format-icon and if not special, checks for "normal-active" and as a fallback and support for the old "active" format-icon, it is not removed.

  • added a check for when a special workspace is active. if true, append a class "has-special-active" to the workspace so you can select it with css as an additional indicator or whatever you like to do with it.

Before: Same active icons for normal and special workspaces, two highlighted workspaces

2025-04-05T04:02:40,774811781+08:00

After: Can have a separate active icon for special workspaces, can style workspace module and its elements if special is not active

2025-04-05T03:56:15,192195304+08:00
2025-04-05T03:53:21,477728137+08:00

My styling use case

#workspaces.has-special-active .active:not(.special) {
    background: none; /* Remove active highlight from normal workspaces */
    color: inherit;
}

How my configuration looks like

  "hyprland/workspaces": {
//truncated for simplicity
    "format-icons": {
    "special-active": "",
    "normal-active": "",
      "active": "", //for backwards compatibility
      "default": "",
      "special" : "",
      "empty" : ""
    },

Feel free to give any opinions. It's just for my personal satisfaction but I thought I might share it cause someone else might be itching a lot about it just like me.

Also, yay my first time ever contributing T.T

…pace is active, the parent workspace module has the class .has-special-active so you can turn off the active style of the non-special one
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.

1 participant