mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 11:15:20 +01:00
[GH-ISSUE #979] [Workspaces] CSS selector for non-visible workspaces that do have windows #300
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vtsionis on GitHub (May 13, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/979
After searching through open and closed issues I couldn't find something related to my request.
In the documentation for the Workspaces module, you can use the
.workspaces .item.visibleand the.workspaces .item.focusedCSS selectors to target the corresponding workspace(s).But how about targeting a non-visible workspace that does have an open window at the moment? Something like
.workspaces .item.activeor similar concept. I am not sure if that is even technically possible but I would love to know your opinion on this.@postsolar commented on GitHub (May 14, 2025):
Is it this or am I misunderstanding something?
@vtsionis commented on GitHub (May 14, 2025):
@postsolar Although that is pure CSS selectors mastery, unfortunately not what I am looking for.
Let me add some screenshots to clarify the case in point.
This is the current behavior with workspace
11being focused:Let's say that I also have one or more windows open in workspaces
12and14, while the focused workspace is still11. Then the module would ideally look something like this:with the corresponding (draft) CSS:
In comparison to @postsolar's snippet, which would look something like this:
I hope that my request is now a bit more clear with the provided screenshots.
@JakeStanger commented on GitHub (May 14, 2025):
Although it is the opposite of the
inactiveselector, I'm not sure I likeactiveas a name, as it's easily confused with the existingfocused.That's given me an idea though...
If I'm understanding correctly, you could view what you're after as selecting everything BUT inactive workspaces. So you could adapt postsolar's idea:
If you need to be more specific to avoid clashing with
focused, you can chain another:noton the end (I think)@vtsionis commented on GitHub (May 15, 2025):
Unfortunately still not what I am going for.
Full disclosure, I am using a Hyprland plugin called
split-monitor-workspaceswhich allows me to have a set of 10 workspaces per monitor (1 to 10 on monitor A and 11 to 20 on monitor B) which are also always visible regardless if they have an open window on them or not. Basically, it is similar to how AwesomeWM handles workspaces. So I don't know if my setup complicates things.In the below screenshot, I have at least one open window on:
.visibleclass.focusedclasswhich with the below
style.csssnippet:produce this end result:
Now what I would like to have is a class that targets workspace 4 and 12 that do have an open window but are not visible nor focused. I also agree that
.activeis not a good choice but as we know, naming things is hard. Maybe something like.non-empty? Just a thought.@JakeStanger commented on GitHub (Sep 7, 2025):
Current plan is to add a new `.populated class name. Use-case has increased with Niri gaining traction.
@carmanaught commented on GitHub (Apr 6, 2026):
I don't know if you already found this out yourself @vtsionis, but I've been trying to style labels the same way and I've found that as long as you set the styling you want on the relevant states including the base
.item, I think you can get the styling you want. I'm also putting this here for anyone else coming across this, since I was trying to achieve the same thing.Specifically, the
.workspaces .itemaffects the items generally, so you can treat that as your "workspace populated but not active or empty", then make sure that the.workspaces .item.inactiveand.workspaces .item.focusedare set.I think what you're wanting should work like this (assuming some color choices here):
That said, it will be best to have the specific
.populatedclass name to target the relevant workspaces, rather than applying styling to the base.item.@vtsionis commented on GitHub (Apr 8, 2026):
Nice thinking @carmanaught but it still doesn't work for me. I've also moved away from using Hyprland and
Ironbarsome time ago, so I didn't do much else on the matter.As a test though, I did try out the suggested snippet, unfortunately without any success. I would like to clarify again that I'm using the
split-monitor-workspacesHyprland plugin to have separate workspaces per monitor. Maybe that is adding more complexity to what I'm trying to achieve.In the below screenshot, you can see at the top is my bar from
Ashell. Workspace 1 is focused, workspace 3 has an open Firefox window while all the rest of the workspaces have no window open.In comparison with the
Ironbarat the bottom, I do get the focused workspace 1 but no indication of the open window on workspace 3. It has the same style as all the rest of the "unpopulated" workspaces.Regardless though, I also think that a dedicated
.populatedclass is the proper way to go here.