Waybar: Configuration per output

Created on 14 Jan 2019  ยท  9Comments  ยท  Source: Alexays/Waybar

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.

enhancement

Most helpful comment

@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}"
    }
}]

All 9 comments

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.

@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}"
    }
}]

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.

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.

Fantastic! Works for me without problem.

Can I buy you a beer or something?

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

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

Yeah add another issue, I'll look at it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmacrae picture cmacrae  ยท  4Comments

atomheartother picture atomheartother  ยท  3Comments

cinghiopinghio picture cinghiopinghio  ยท  4Comments

piu130 picture piu130  ยท  4Comments

0xdec picture 0xdec  ยท  4Comments