eww icon indicating copy to clipboard operation
eww copied to clipboard

[BUG] Eww uses monitor model instead of a serial

Open coderPaddyS opened this issue 10 months ago • 5 comments

Checklist before submitting an issue

  • [X] I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • [X] I have specifically verified that this bug is not a common user error
  • [X] I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

Spawning a widget on each monitor is only possible, if they aren't the same model. If they are, eww will spawn the widget on the same monitor. Using the monitor serial primarily and the model as fallback (or any property specified by the user) or the monitor description would resolve this issue. Usage of an index as id could be a solution, but sometimes the monitor ordering is not the same as reported by the DE (in my case Hyprland) as seen below. Eww uses the same ordering in which my DE lists the monitors, not by the ID.

Reproducing the issue

$>eww open bar --id 1 --arg screen=609NTFAF4483
failed to open window `1`

Caused by:
    Failed to get monitor 609NTFAF4483
    The available monitors are:
        [0] 0x1551
        [1] 24EB23
        [2] 24EB23

The monitor ordering:

$> hyprctl monitors
Monitor eDP-1 (ID 0):
        [email protected] at 960x1200
        description: Sharp Corporation 0x1551
        make: Sharp Corporation
        model: 0x1551
        serial:

Monitor DP-8 (ID 2):
        [email protected] at 1920x0
        description: LG Electronics 24EB23 305NDGL87831
        make: LG Electronics
        model: 24EB23
        serial: 305NDGL87831


Monitor DP-7 (ID 1):
        [email protected] at 0x0
        description: LG Electronics 24EB23 609NTFAF4483
        make: LG Electronics
        model: 24EB23
        serial: 609NTFAF4483

Expected behaviour

Eww spawns a window on each monitor correctly by specifying the serial, model or description of the monitor.

Additional context

2024-04-25T15:14:54,802040489+02:00

coderPaddyS avatar Apr 25 '24 13:04 coderPaddyS

Having the same issue, after suspend/resume or reboot eww sees the monitor order differently which puts my bars in the wrong location. wayland-info and hyprctl monitors always shows the correct info, order is not changed there.

I have tried using the JSON monitor matcher but specifying DP-1/2/3 doesn't seem to do anything, only matching the monitor model is working but as I have 3 screens and 2 are of the same model this is a problem.

Making matching possible on display port, e.g. DP-1/2/3 would be a nice solution and I guess according to the docs this should be working so this probably is a bug?

krims0n32 avatar Apr 25 '24 14:04 krims0n32

Yea, I've noticed the issue that monitor specifications on wayland are kind of annoyingly meaningless. I haven't yet figured out how to get any more specific info through GTK, though -- if anyone has any ideas or would be willing to tackle an implementation of a fix for this, I'd love that! GTK doesn't give me all that much info about the underlying wayland monitor, and I'm unsure how much details I can get about the monitor in a standardized way on wayland either way :/

elkowar avatar Apr 27 '24 09:04 elkowar

I'm not that experienced with the wayland protocol and gtk, but it seems that migrating to gtk4 would atleast allow to get the monitor information in an easy fashion. Would it be feasible to migrate? Is a migration even wanted? If so, I'd could try to implement the migration, but someone with more experience should most definitely look at it thoroughly and it would most likely not be backwards compatible to the gtk3 based config.

coderPaddyS avatar Apr 29 '24 09:04 coderPaddyS

There is some discussion and a proposed fix for another bar here:

https://github.com/Aylur/ags/issues/363

Maybe this could help you? If I can do anything to debug this, let me know.

krims0n32 avatar May 07 '24 15:05 krims0n32

should be fixed by 510b824e7545a7c98e050522a7bc93d884c53432, we use the deprecated api directly now :D

w-lfchen avatar Aug 25 '24 18:08 w-lfchen