nwg-piotr/azote

Newer sway/wlroots name certain outputs randomly causing displays not to have a bg image

luispabon opened this issue ยท 13 comments

Describe the bug
Looks like on the last versions of sway and wlroots, virtual outputs (like those on a thunderbolt dock) are named randomly. I have two displays on a thunderbolt dock that keep changing X where DP-X. Those outputs are virtual (one is in fact VGA and the other HDMI, but from the system's point of view they're displayport).

Anyhow the net result is that sometimes, when an output name is changed at random, I won't have a background image in there. For instance, this is the azotebg script before after I fixed it this morning because one of the displays somehow changed DP number after resuming from sleep:

# Before
 ~ cat .azotebg  
#!/usr/bin/env bash
pkill swaybg
swaybg -o DP-8 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill &
swaybg -o eDP-1 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill &
swaybg -o DP-7 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill &

# After
 ~ cat .azotebg 
#!/usr/bin/env bash
pkill swaybg
swaybg -o DP-7 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill &
swaybg -o eDP-1 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill &
swaybg -o DP-10 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill &

To Reproduce
It's pretty hard to reproduce, unless you have my setup exactly.

Expected behavior
The output names change, but obviously the display names remain the same. Perhaps the script could use these instead?

So instead of

swaybg -o DP-7 -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill

We could have:

swaybg -o "Iiyama North America PL2410HD 11046A0B03094" -i '/home/luis/Pictures/backgrounds/59853.jpg' -m fill

This is in fact the recommended method of configuring your display layouts in Kanshi so that you can have different setups off the same hardware ports (eg built in HDMI and eDP) as it's the only effective way to identify a particular screen.

Desktop (please complete the following information):

  • Linux distribution: Ubuntu 21.04
  • WM: Sway 1.6-rc2, wlroots master (pre 0.13)

Azote version (please state it clearly if you use -git version):
v1.9.0

This looks bad, and I wonder if it only affects outputs connected via Thunderbolt. One way or another, it should be submitted as the sway issue: the problem is swaybg-related. Well, they might have changed something in swaybg... I haven't yet seen the new sway.

Well it's the output port that keeps changing. I've no idea how that works internally in sway, but the dock's ports have always been reporting as display port, never mind they're HDMI, VGA (both that I use) or the actual DP and miniDP that are also present.

Azote relies on swaybg. I'm not sure if we can use output generic names here. On my setup they look like this:

Output eDP-1 'Unknown 0xD0ED 0x00000000'
Output DP-1 'Unknown 2475WR 0x00000101'
Output HDMI-A-1 'Unknown 22V2WG5 0x00000074'

Alright, it seems we can. I'll take a closer look at this tonight. Will you help at testing?

Goes without saying ๐Ÿ‘

Very well. I'm about to finish tuning nwg-panel. Will try to fix your issue as soon as it's done.

Would you be able to give a try to the display-names branch? I need to build the generic name out 3 fields like this:

'generic-name': "{} {} {}".format(output["make"], output["model"], output["serial"])

I'm not sure if it's going to always work as expected. If it does, I could just leave it as is. Otherwise we would need a switch - if to use output names or generic display names. But the first thing I need to know is if it works on your hardware.

Success!

recording.mp4

Very well. I think I should add the switch in settings anyway - just in case. I'll do it today or tomorrow and publish a new release. Can't promise this to be tonight, as I'm slightly obsessed with another project in Go. ๐Ÿ˜ˆ

Go-od stuff mate ๐Ÿ‘

2021-03-28-031005_screenshot

Awesome, thank you Piotr ๐Ÿ‘๐Ÿฝ

Thanks for reporting the issue.