Waybar ignores swaymsg bar <bar> output commands
I have set waybar with sway ipc to be able to write a script that will move the bar to the second outputwhen an app on my main output is fullscreen. I have figured out how to properly subscribe and detect when an app goes fullscreen yet I can't move the bar because waybar completely ignores my swaymsg bar bar-0 output HDMI-A-1 command. The IPC is working correctly though, which I can verify by running swaymsg bar bar-0 mode hide and seeing the bar disappear. Am I doing something wrong or is that a bug?
I'm having similar issue. For me, nothing from man sway-bar doesn't seem to work except swaymsg bar bar-0 mode <mode>. I think it may be related to #1244 or #1516, but when I revert this PRs, it doesn't compile...
@alebastr @Alexays it seems like the IPC command to change output is not implemented, right?
This is not currently implemented. And it's a nontrivial change.
Bars don't manage what outputs they are displayed on. When a bar is created it is told which output to use. Therefore IPC requests to change outputs can't work because a bar would have to replace itself with a different bar.
Additionally, each bar has it's own Sway IPC connection. The Sway IPC connection code needs to be changed so it is owned by the Client class (and not a Bar) so that output changes can cause a bar to be destroyed and replaced with one on the correct output.
Does that sound correct to you @alebastr?
For now, the best workaround is to use output names in the output array for a bar:
{
"output": ["eDP-1", "Samsung Electric Company S32D850 0x304C3341"]
}
You'll end up with more than one bar but at least it will be on the display you want without showing up on all monitors you plug into.
Any plans to implement this?
@alebastr @Alexays
Is there a way to fallback if the display is not there, eg I've unplugged my laptop from the big displays?