[GH-ISSUE #282] [Workspaces] Visible workspaces CSS selector #8545

Closed
opened 2026-05-23 03:52:43 +01:00 by JakeStanger · 7 comments
Owner

Originally created by @malicean on GitHub (Aug 23, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/282

Is your feature request related to a problem? Please describe.
I'm migrating from Waybar and noticed that there's no CSS selector for visible workspaces. I use two monitors, but since I do all my work on my left monitor, workspaces buttons for my right monitor are never highlighted (active).

Describe the solution you'd like
A CSS selector such as .workspaces .item.visible which is active for workspace buttons whose workspaces are currently visible, including the active one.

Describe alternatives you've considered
After writing the previous section, I noticed that there's .workspaces .item.inactive (implementation) from #147, but it doesn't do anything. Looking at the call sites, all 3 of them have the inactive parameter set to false, which would explain why. I think this is what the variable is supposed to represent, but there's no documentation aside from the comment in #90. I'll try to get it working for this purpose, but I figured I should post the issue regardless.

Originally created by @malicean on GitHub (Aug 23, 2023). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/282 **Is your feature request related to a problem? Please describe.** I'm migrating from Waybar and noticed that there's no CSS selector for visible workspaces. I use two monitors, but since I do all my work on my left monitor, workspaces buttons for my right monitor are never highlighted (active). **Describe the solution you'd like** A CSS selector such as `.workspaces .item.visible` which is active for workspace buttons whose workspaces are currently visible, including the active one. **Describe alternatives you've considered** After writing the previous section, I noticed that there's `.workspaces .item.inactive` ([implementation](https://github.com/JakeStanger/ironbar/blob/master/src/modules/workspaces.rs#L97)) from #147, but it doesn't do anything. Looking at the call sites, all 3 of them have the `inactive` parameter set to `false`, which would explain why. I think this is what the variable is supposed to represent, but there's no documentation aside from the comment in #90. I'll try to get it working for this purpose, but I figured I should post the issue regardless.
Author
Owner

@malicean commented on GitHub (Aug 24, 2023):

Ah, nevermind, I see that inactive is for favorited workspaces that don't exist.

<!-- gh-comment-id:1690902853 --> @malicean commented on GitHub (Aug 24, 2023): Ah, nevermind, I see that inactive is for favorited workspaces that don't exist.
Author
Owner

@malicean commented on GitHub (Aug 24, 2023):

I ended up getting it working, the code's on my fork. I realize discussion before writing is the convention, but this is a big QoL to me. If needed, I can adjust design.

<!-- gh-comment-id:1690959969 --> @malicean commented on GitHub (Aug 24, 2023): I ended up getting it working, the code's on my fork. I realize discussion before writing is the convention, but this is a big QoL to me. If needed, I can adjust design.
Author
Owner

@yavko commented on GitHub (Aug 24, 2023):

h, nevermind, I see that inactive is for favorited workspaces that don't exist.

yuh

<!-- gh-comment-id:1690996323 --> @yavko commented on GitHub (Aug 24, 2023): > h, nevermind, I see that inactive is for favorited workspaces that don't exist. yuh
Author
Owner

@yavko commented on GitHub (Aug 24, 2023):

Is your feature request related to a problem? Please describe. I'm migrating from Waybar and noticed that there's no CSS selector for visible workspaces. I use two monitors, but since I do all my work on my left monitor, workspaces buttons for my right monitor are never highlighted (active).

Describe the solution you'd like A CSS selector such as .workspaces .item.visible which is active for workspace buttons whose workspaces are currently visible, including the active one.

Describe alternatives you've considered After writing the previous section, I noticed that there's .workspaces .item.inactive (implementation) from #147, but it doesn't do anything. Looking at the call sites, all 3 of them have the inactive parameter set to false, which would explain why. I think this is what the variable is supposed to represent, but there's no documentation aside from the comment in #90. I'll try to get it working for this purpose, but I figured I should post the issue regardless.

If ur trying to get workspaces that exist, but aren't focused you could just use :is(:not(.focused), :not(.inactive)) or something, ofc idk if this works in gtk css, but i hope so

<!-- gh-comment-id:1691002102 --> @yavko commented on GitHub (Aug 24, 2023): > **Is your feature request related to a problem? Please describe.** I'm migrating from Waybar and noticed that there's no CSS selector for visible workspaces. I use two monitors, but since I do all my work on my left monitor, workspaces buttons for my right monitor are never highlighted (active). > > **Describe the solution you'd like** A CSS selector such as `.workspaces .item.visible` which is active for workspace buttons whose workspaces are currently visible, including the active one. > > **Describe alternatives you've considered** After writing the previous section, I noticed that there's `.workspaces .item.inactive` ([implementation](https://github.com/JakeStanger/ironbar/blob/master/src/modules/workspaces.rs#L97)) from #147, but it doesn't do anything. Looking at the call sites, all 3 of them have the `inactive` parameter set to `false`, which would explain why. I think this is what the variable is supposed to represent, but there's no documentation aside from the comment in #90. I'll try to get it working for this purpose, but I figured I should post the issue regardless. If ur trying to get workspaces that exist, but aren't focused you could just use `:is(:not(.focused), :not(.inactive))` or something, ofc idk if this works in gtk css, but i hope so
Author
Owner

@yavko commented on GitHub (Aug 24, 2023):

but there's no documentation aside from the comment

That's my oopsie sorry, .inactive is for fake workspace that dont actually exist, but are in favorites list

<!-- gh-comment-id:1691003322 --> @yavko commented on GitHub (Aug 24, 2023): > but there's no documentation aside from the comment That's my oopsie sorry, `.inactive` is for fake workspace that dont actually exist, but are in favorites list
Author
Owner

@malicean commented on GitHub (Aug 24, 2023):

If ur trying to get workspaces that exist, but aren't focused you could just use :is(:not(.focused), :not(.inactive)) or something, ofc idk if this works in gtk css, but i hope so

The problem isn't what exists but isn't focused, but what exists and is visible. I have 6-10 allocated to my right monitor (via Hyprland config), the rest to the left. Usually most of 6-10 exist, but only one is visible at a time. My left monitor is where I get work done, so 1-5 is almost always focused, leaving most of 6-10 existing but with no indicator as to which one I'm looking at

<!-- gh-comment-id:1691831135 --> @malicean commented on GitHub (Aug 24, 2023): > If ur trying to get workspaces that exist, but aren't focused you could just use `:is(:not(.focused), :not(.inactive))` or something, ofc idk if this works in gtk css, but i hope so The problem isn't what exists but isn't focused, but what exists and is visible. I have 6-10 allocated to my right monitor (via Hyprland config), the rest to the left. Usually most of 6-10 exist, but only one is visible at a time. My left monitor is where I get work done, so 1-5 is almost always focused, leaving most of 6-10 existing but with no indicator as to which one I'm looking at
Author
Owner

@JakeStanger commented on GitHub (Aug 24, 2023):

I ended up getting it working, the code's on my fork. I realize discussion before writing is the convention, but this is a big QoL to me. If needed, I can adjust design.

Agreed this is a good QoL addition & deffo makes sense to add it in. If you're able to open a PR, I'll review/merge when I can :)

I'll also look to get the docs updated in a sec to add that missing .inactive selector.

<!-- gh-comment-id:1692495613 --> @JakeStanger commented on GitHub (Aug 24, 2023): > I ended up getting it working, the code's on my fork. I realize discussion before writing is the convention, but this is a big QoL to me. If needed, I can adjust design. Agreed this is a good QoL addition & deffo makes sense to add it in. If you're able to open a PR, I'll review/merge when I can :) I'll also look to get the docs updated in a sec to add that missing `.inactive` selector.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#8545
No description provided.