Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waybar ignores swaymsg bar <bar> output commands #2061

Open
SergeyKasmy opened this issue Mar 18, 2023 · 6 comments
Open

Waybar ignores swaymsg bar <bar> output commands #2061

SergeyKasmy opened this issue Mar 18, 2023 · 6 comments

Comments

@SergeyKasmy
Copy link

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?

@dmyTRUEk
Copy link

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...

@napaalm
Copy link

napaalm commented Aug 3, 2024

@alebastr @Alexays it seems like the IPC command to change output is not implemented, right?

@pjones
Copy link
Contributor

pjones commented Aug 15, 2024

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.

@napaalm
Copy link

napaalm commented Sep 4, 2024

Any plans to implement this?

@napaalm
Copy link

napaalm commented Sep 4, 2024

@alebastr @Alexays

@rileyrg
Copy link

rileyrg commented Oct 1, 2024

Is there a way to fallback if the display is not there, eg I've unplugged my laptop from the big displays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants