Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Configuration per output

Open mithodin opened this issue 7 years ago • 14 comments

I'd like to be able to configure waybar per output, or possibly show it only on one output under sway. If this is currently possible, it is not documented.

mithodin avatar Jan 14 '19 12:01 mithodin

No, it's not possible, I don't think it's complicated to do. I'll do it when I have some time available or if someone else feels capable before.

Alexays avatar Jan 14 '19 13:01 Alexays

@mithodin Now implemented in 0ddcf26a45b15e7e96dc7c917556239369d63014 I can't test it right now, but it should work :) How to use

{
    "layer": "top",
	"output": "eDp-1", <--- 
	"output": ["eDp-1", "VGA"], <--- Multiple output with same configuration 
    "modules-left": ["sway/workspaces", "sway/mode"],
    "modules-center": ["sway/window"],
    "modules-right": ["battery", "clock"],
    "sway/window": {
        "max-length": 50
    },
    "battery": {
        "format": "{capacity}% {icon}",
        "format-icons": ["", "", "", "", ""]
    },
    "clock": {
        "format-alt": "{:%a, %d. %b  %H:%M}"
    }
}

And for different configuration per output with one waybar process

[{
    "layer": "top",
	"output": "eDp-1", 
    "modules-left": ["sway/workspaces", "sway/mode"],
    "modules-center": ["sway/window"],
    "modules-right": ["battery", "clock"],
    "sway/window": {
        "max-length": 50
    },
    "battery": {
        "format": "{capacity}% {icon}",
        "format-icons": ["", "", "", "", ""]
    },
    "clock": {
        "format-alt": "{:%a, %d. %b  %H:%M}"
    }
}, {
    "layer": "top",
	"output": "VGA"
    "modules-right": [ "clock"],
    "clock": {
        "format-alt": "{:%a, %d. %b  %H:%M}"
    }
}]

Alexays avatar Feb 01 '19 20:02 Alexays

I'm using this atm and I am able to run this on one monitor with a 3 monitor setup. Not interested in other configurations so I have not tested them out.

alexthebuilder avatar Feb 01 '19 23:02 alexthebuilder

One comment I have is that if I have an active window on another output and focus_follows_mouse = no in sway. If I hover over a module for a tooltip my mouse will be moved to the output my active window is in. If my mouse is focused on the output where my bar is, the tooltip shows.

Not a major bug but was disorienting the first time it happened.

alexthebuilder avatar Feb 02 '19 01:02 alexthebuilder

Fantastic! Works for me without problem.

mithodin avatar Feb 04 '19 08:02 mithodin

Can I buy you a beer or something?

mithodin avatar Feb 04 '19 08:02 mithodin

@mithodin I added a donation badge on the readme, it's always nice that his work is appreciated :smile:

Alexays avatar Feb 04 '19 09:02 Alexays

Let me know if you would like another issue opened for his but if I turn off the monitor that has the bar and turn it back on the bar does not come back. Below is the error messages I receive. Waybar does not terminate it just seems unable to add itself back to the monitor when it is turned back on.

Bar removed from output: DP-1 Workspaces: Unable to receive IPC payload Mode: Unable to receive IPC header Window: Unable to receive IPC header

alexthebuilder avatar Feb 04 '19 16:02 alexthebuilder

Yeah add another issue, I'll look at it

Alexays avatar Feb 04 '19 16:02 Alexays

Sorry for necrobumping but I dont think this warrants a separate issue.

Is it possible to use wildcards? I for example want to use the same config on every single display I plug in so instead of doing:

"output": ["eDp-1", "DP-1", "DP-2", "VGA"], <--- Multiple output with same configuration 

we could just do something like this:

"output": "*",

NiciTheNici avatar May 19 '23 20:05 NiciTheNici

Sorry for necrobumping but I dont think this warrants a separate issue.

Is it possible to use wildcards? I for example want to use the same config on every single display I plug in so instead of doing:

"output": ["eDp-1", "DP-1", "DP-2", "VGA"], <--- Multiple output with same configuration 

we could just do something like this:

"output": "*",

just ommiting the "output" key, already does this behavior @NiciTheNici

ogabriel avatar Oct 22 '23 12:10 ogabriel

is there a way to specify the output in the style.css too? would like to have different css for each monitor.

lilly-lizard avatar Jul 10 '24 05:07 lilly-lizard

I am also looking to change the styles for different outputs. Specifically, I want to reduce the font size on the 1080p display to closely match the visually smaller size on the 4k display.

keystroke3 avatar Jul 13 '24 10:07 keystroke3

@keystroke3 in config file you need to make two identical bars but with different names and after in css file add
.left { font-size: 13px; min-height: 15px; } .right { font-size: 22px; min-height: 25px; }

koowyzrk avatar Jul 23 '24 08:07 koowyzrk