polybar
polybar copied to clipboard
i3 module: Ability to style based on monitor
Why does polybar need this feature?
I think this would be useful for users with 2 or more monitors. For example, I had the idea to add a differently colored overline for each monitor. Right now I see no way to do that, even though the monitor information is available to polybar itself (for example, it's possible to put it in the label)
Describe the solution you'd like
I'm not quite sure - my initial idea was to have an additional label type for unfocused on current monitor vs unfocused on other monitors, but I couldn't come up with a good name for it and it wouldn't work for more than two monitors...
Maybe there could be something like monitor-0-overline
- have per-monitor styles defined, and then decide that either the focus
styles override the monitor
styles or vice versa in case of a clash.
I think this is outside of the scope of this project.
Polybar itself only runs on a single monitor at a time. If you have bars on multiple monitors you have started multiple separate bars. Because of that, there are at least two ways to realize something like this yourself:
- Create different bar definitions with different styles for the two monitors and create two separate i3 module with the new colors.
- When launching your bars, export environment variables containing colors and other styles for that monitor. In your config you can then make use of
${env:...}
to load those variables.
There are probably also other ways.
Things like inheritance can be very useful in the first approach.
@patrick96 , I think you misunderstood what I wanted - I want to be able to style workspaces on the same bar differently based on which monitor they're assigned to, not based on which monitor the bar is on.
Oh, I see. That makes a lot more sense.
The bspwm module already has a similar thing with label-dimmed-*
, where the dimmed variant of a label is used for labels whose monitor is not focused. The same could probably be done with the i3 module.
This doesn't really have priority, so contributions will have to come from you or someone else for this to get done.
As always, PRs are welcome ;)
I'd like to work on this one. I'll look at how the bspwm module is configured and see what I can do from there.
@dvermd Nice :)
Let me know if you need anything. Also maybe before you invest too much time into implementing something, maybe check back with a rough concept just to see if you're going in the right direction.