JakeStanger / ironbar

Customisable Wayland gtk bar written in Rust.
https://crates.io/crates/ironbar
MIT License
482 stars 36 forks source link

[Question] ChromeOS style and related problems #619

Open madfanat opened 1 month ago

madfanat commented 1 month ago

Is your question related to a problem? Please describe. I've tried to set specific border-radius for the edge nodules, but without success. The settings apply to the children of the children of the bar, not the children of the bar. For example, #bar #start .item:not(:first_child):not(:last_child) applies to workspace entries, but no to the workspace widget itself. Here's exactly what I tried:

#bar #end {
}
#bar #end .item:not(:first_child):not(:last_child) {
}
#bar #end > *:nth-child(1) {
}
#bar #end :not(:first_child):not(:last_child) {
}
#bar #end:not(:first_child):not(:last_child) {
}

Describe the solution you'd like

Describe alternatives you've considered

Additional context image

JakeStanger commented 1 month ago

Setting specific border-radius for the first and the last modules on the right side of the bar

For this you can use the .widget selector, eg .widget:first-child to select the first in any of start/center/end (or be specific with .workspace:first-child).

Hide the tray widget when there are no items so it doesn't take up space

Currently this is not possible through Ironbar itself, although I am possibly looking to change that as part of the next update or so.

You could potentially do this using show_if and an external script which checks DBus. You can look at org.kde.StatusNotifierWatcher StatusNotifierWatcher and the RegisteredStatusNotifierItems property.

image

Hide the notification widget when there are no notifications so it doesn't take up space

Same story as above currently. swaync exposes a pretty good DBus interface you can query to find the count:

image

madfanat commented 1 month ago

For this you can use the .widget selector, eg .widget:first-child to select the first in any of start/center/end (or be specific with .workspace:first-child).

Well, I guess it applies to the first element of the module (like the first instance of a clock or volume control). But I want it to apply to the edge widgets on the right side of the bar. In this case, the first would be the volume control and the last would be the notification widget. And I want to apply border-radius to the widget itself, not to its child items. Here's what I got now:

image

JakeStanger commented 1 month ago

Well, I guess it applies to the first element of the module

Incorrect, it applies to any widget which is the first in its container. So you can do

.end .widget:first-child

or

.end .volume:first-child

to select it

madfanat commented 1 month ago

Oh, then I'll try to explain more clearly. I want to work with the edge widgets (containers?) on the right side of the bar. In this case, I'm representing the list like this: [volume, clock, notifications]. And I want to select the first and the last items of the list and assign certain properties to them. In this case it would be volume and notification widgets.

JakeStanger commented 1 month ago

Have you tried the selectors above to see if they work for you?

madfanat commented 1 month ago

Yeah, I've tried that and I don't see any impact for some reason. What I want would just be a contraction of

.volume, 
.clock {
  border-radius: 0;
}