nwg-piotr / nwg-displays

Output management utility for sway and Hyprland.
MIT License
334 stars 22 forks source link

Crash on Start after update #22

Closed RononDex closed 1 year ago

RononDex commented 1 year ago

After updating my packages, nwg-disüpplays will not start anymore:

❯ nwg-displays
WARNING: Couldn't find sway config directory '/home/cobra/.config/sway'
Settings: {'view-scale': 0.15, 'snap-threshold': 10, 'indicator-timeout': 500, 'custom-mode': []}
Running on Hyprland
DP-7 {'description': 'HP Inc. HP Z24n G2 6CM8201WNG', 'active': True, 'focused': False, 'modes': [{'width': 1920, 'height': 1200, 'refresh': 59950.001000000004}, {'width': 1920, 'height': 1200, 'refresh': 74939.003}, {'width': 1920, 'height': 1080, 'refresh': 60000.0}, {'width': 1920, 'height': 1080, 'refresh': 60000.0}, {'width': 1920, 'height': 1080, 'refresh': 59939.999}, {'width': 1920, 'height': 1080, 'refresh': 50000.0}, {'width': 1920, 'height': 1080, 'refresh': 50000.0}, {'width': 1600, 'height': 1200, 'refresh': 60000.0}, {'width': 1680, 'height': 1050, 'refresh': 59953.999}, {'width': 1600, 'height': 900, 'refresh': 60000.0}, {'width': 1280, 'height': 1024, 'refresh': 75025.00200000001}, {'width': 1280, 'height': 1024, 'refresh': 60020.0}, {'width': 1440, 'height': 900, 'refresh': 59887.001}, {'width': 1280, 'height': 800, 'refresh': 59810.001}, {'width': 1280, 'height': 720, 'refresh': 60000.0}, {'width': 1280, 'height': 720, 'refresh': 60000.0}, {'width': 1280, 'height': 720, 'refresh': 59939.999}, {'width': 1280, 'height': 720, 'refresh': 50000.0}, {'width': 1024, 'height': 768, 'refresh': 75028.999}, {'width': 1024, 'height': 768, 'refresh': 60004.002}, {'width': 800, 'height': 600, 'refresh': 75000.0}, {'width': 800, 'height': 600, 'refresh': 60317.001}, {'width': 720, 'height': 576, 'refresh': 50000.0}, {'width': 720, 'height': 576, 'refresh': 50000.0}, {'width': 720, 'height': 480, 'refresh': 60000.0}, {'width': 720, 'height': 480, 'refresh': 60000.0}, {'width': 720, 'height': 480, 'refresh': 59939.999}, {'width': 720, 'height': 480, 'refresh': 59939.999}, {'width': 640, 'height': 480, 'refresh': 75000.0}, {'width': 640, 'height': 480, 'refresh': 60000.0}, {'width': 640, 'height': 480, 'refresh': 59939.999}, {'width': 640, 'height': 480, 'refresh': 59939.999}, {'width': 720, 'height': 400, 'refresh': 70082.001}], 'scale_filter': None, 'dpms': None, 'mirror': 'eDP-1', 'monitor': <__gi__.GdkWaylandMonitor object at 0x7f7af5968b00 (GdkWaylandMonitor at 0x55970e1ee840)>, 'physical-width': 1920, 'physical-height': 1200, 'refresh': 59.950001, 'x': 0, 'y': 0, 'transform': 'normal', 'scale': 1.0, 'logical-width': 1920.0, 'logical-height': 1200.0}
DP-5 {'description': 'HP Inc. HP Z24n G2 6CM8201WYD', 'active': True, 'focused': False, 'modes': [{'width': 1920, 'height': 1200, 'refresh': 59950.001000000004}, {'width': 1920, 'height': 1200, 'refresh': 74939.003}, {'width': 1920, 'height': 1080, 'refresh': 60000.0}, {'width': 1920, 'height': 1080, 'refresh': 60000.0}, {'width': 1920, 'height': 1080, 'refresh': 59939.999}, {'width': 1920, 'height': 1080, 'refresh': 50000.0}, {'width': 1920, 'height': 1080, 'refresh': 50000.0}, {'width': 1600, 'height': 1200, 'refresh': 60000.0}, {'width': 1680, 'height': 1050, 'refresh': 59953.999}, {'width': 1600, 'height': 900, 'refresh': 60000.0}, {'width': 1280, 'height': 1024, 'refresh': 75025.00200000001}, {'width': 1280, 'height': 1024, 'refresh': 60020.0}, {'width': 1440, 'height': 900, 'refresh': 59887.001}, {'width': 1280, 'height': 800, 'refresh': 59810.001}, {'width': 1280, 'height': 720, 'refresh': 60000.0}, {'width': 1280, 'height': 720, 'refresh': 60000.0}, {'width': 1280, 'height': 720, 'refresh': 59939.999}, {'width': 1280, 'height': 720, 'refresh': 50000.0}, {'width': 1024, 'height': 768, 'refresh': 75028.999}, {'width': 1024, 'height': 768, 'refresh': 60004.002}, {'width': 800, 'height': 600, 'refresh': 75000.0}, {'width': 800, 'height': 600, 'refresh': 60317.001}, {'width': 720, 'height': 576, 'refresh': 50000.0}, {'width': 720, 'height': 576, 'refresh': 50000.0}, {'width': 720, 'height': 480, 'refresh': 60000.0}, {'width': 720, 'height': 480, 'refresh': 60000.0}, {'width': 720, 'height': 480, 'refresh': 59939.999}, {'width': 720, 'height': 480, 'refresh': 59939.999}, {'width': 640, 'height': 480, 'refresh': 75000.0}, {'width': 640, 'height': 480, 'refresh': 60000.0}, {'width': 640, 'height': 480, 'refresh': 59939.999}, {'width': 640, 'height': 480, 'refresh': 59939.999}, {'width': 720, 'height': 400, 'refresh': 70082.001}], 'scale_filter': None, 'dpms': None, 'mirror': '', 'monitor': <__gi__.GdkWaylandMonitor object at 0x7f7af5968c80 (GdkWaylandMonitor at 0x55970e1d6140)>, 'physical-width': 1920, 'physical-height': 1200, 'refresh': 59.950001, 'x': 1920, 'y': 0, 'transform': 'normal', 'scale': 1.0, 'logical-width': 1920.0, 'logical-height': 1200.0, 'adaptive_sync_status': 'disabled'}
eDP-1 {'description': 'LG Display 0x06CE', 'active': True, 'focused': False, 'modes': [{'width': 1920, 'height': 1200, 'refresh': 59950.001000000004}], 'scale_filter': None, 'dpms': None, 'mirror': '', 'monitor': None, 'physical-width': 1920, 'physical-height': 1200, 'refresh': 59.950001, 'x': 0, 'y': 0, 'transform': 'normal', 'scale': 1.199219, 'logical-width': 1601.0420115091572, 'logical-height': 1000.6512571932233, 'adaptive_sync_status': 'disabled'}
Traceback (most recent call last):
  File "/usr/bin/nwg-displays", line 33, in <module>
    sys.exit(load_entry_point('nwg-displays==0.3.5', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 1002, in main
    create_display_buttons()
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 542, in create_display_buttons
    item["active"], item["dpms"], item["adaptive_sync_status"], custom_mode, item["focused"],
                                  ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'adaptive_sync_status'
nwg-piotr commented 1 year ago

I need to know your Linux distribution. Also, please paste the output of 2 commands:

RononDex commented 1 year ago

I am on Arch Linux

wlr-randr:

❯ wlr-randr
DP-7 "HP Inc. HP Z24n G2 6CM8201WNG (DP-7)"
  Make: HP Inc.
  Model: HP Z24n G2
  Serial: 6CM8201WNG
  Physical size: 520x320 mm
  Enabled: yes
  Modes:
    1920x1200 px, 59.950001 Hz (preferred, current)
    1920x1200 px, 74.939003 Hz
    1920x1080 px, 60.000000 Hz
    1920x1080 px, 60.000000 Hz
    1920x1080 px, 59.939999 Hz
    1920x1080 px, 50.000000 Hz
    1920x1080 px, 50.000000 Hz
    1600x1200 px, 60.000000 Hz
    1680x1050 px, 59.953999 Hz
    1600x900 px, 60.000000 Hz
    1280x1024 px, 75.025002 Hz
    1280x1024 px, 60.020000 Hz
    1440x900 px, 59.887001 Hz
    1280x800 px, 59.810001 Hz
    1280x720 px, 60.000000 Hz
    1280x720 px, 60.000000 Hz
    1280x720 px, 59.939999 Hz
    1280x720 px, 50.000000 Hz
    1024x768 px, 75.028999 Hz
    1024x768 px, 60.004002 Hz
    800x600 px, 75.000000 Hz
    800x600 px, 60.317001 Hz
    720x576 px, 50.000000 Hz
    720x576 px, 50.000000 Hz
    720x480 px, 60.000000 Hz
    720x480 px, 60.000000 Hz
    720x480 px, 59.939999 Hz
    720x480 px, 59.939999 Hz
    640x480 px, 75.000000 Hz
    640x480 px, 60.000000 Hz
    640x480 px, 59.939999 Hz
    640x480 px, 59.939999 Hz
    720x400 px, 70.082001 Hz
  Position: 0,0
  Transform: normal
  Scale: 1.000000
  Adaptive Sync: disabled
DP-5 "HP Inc. HP Z24n G2 6CM8201WYD (DP-5)"
  Make: HP Inc.
  Model: HP Z24n G2
  Serial: 6CM8201WYD
  Physical size: 520x320 mm
  Enabled: yes
  Modes:
    1920x1200 px, 59.950001 Hz (preferred, current)
    1920x1200 px, 74.939003 Hz
    1920x1080 px, 60.000000 Hz
    1920x1080 px, 60.000000 Hz
    1920x1080 px, 59.939999 Hz
    1920x1080 px, 50.000000 Hz
    1920x1080 px, 50.000000 Hz
    1600x1200 px, 60.000000 Hz
    1680x1050 px, 59.953999 Hz
    1600x900 px, 60.000000 Hz
    1280x1024 px, 75.025002 Hz
    1280x1024 px, 60.020000 Hz
    1440x900 px, 59.887001 Hz
    1280x800 px, 59.810001 Hz
    1280x720 px, 60.000000 Hz
    1280x720 px, 60.000000 Hz
    1280x720 px, 59.939999 Hz
    1280x720 px, 50.000000 Hz
    1024x768 px, 75.028999 Hz
    1024x768 px, 60.004002 Hz
    800x600 px, 75.000000 Hz
    800x600 px, 60.317001 Hz
    720x576 px, 50.000000 Hz
    720x576 px, 50.000000 Hz
    720x480 px, 60.000000 Hz
    720x480 px, 60.000000 Hz
    720x480 px, 59.939999 Hz
    720x480 px, 59.939999 Hz
    640x480 px, 75.000000 Hz
    640x480 px, 60.000000 Hz
    640x480 px, 59.939999 Hz
    640x480 px, 59.939999 Hz
    720x400 px, 70.082001 Hz
  Position: 1920,0
  Transform: normal
  Scale: 1.000000
  Adaptive Sync: disabled
eDP-1 "LG Display 0x06CE (eDP-1)"
  Make: LG Display
  Model: 0x06CE
  Serial: (null)
  Physical size: 290x180 mm
  Enabled: yes
  Modes:
    1920x1200 px, 59.950001 Hz (preferred, current)
  Position: 0,0
  Transform: normal
  Scale: 1.199219
  Adaptive Sync: disabled

hypprctl -j monitors:

❯ hyprctl -j monitors
[{
    "id": 0,
    "name": "eDP-1",
    "description": "LG Display 0x06CE (eDP-1)",
    "make": "LG Display",
    "model": "0x06CE",
    "serial": "",
    "width": 1920,
    "height": 1200,
    "refreshRate": 59.950001,
    "x": 0,
    "y": 0,
    "activeWorkspace": {
        "id": 1,
        "name": "1"
    },
    "reserved": [0, 22, 0, 37],
    "scale": 1.20,
    "transform": 0,
    "focused": true,
    "dpmsStatus": true,
    "vrr": false
},{
    "id": 1,
    "name": "DP-5",
    "description": "HP Inc. HP Z24n G2 6CM8201WYD (DP-5)",
    "make": "HP Inc.",
    "model": "HP Z24n G2",
    "serial": "6CM8201WYD",
    "width": 1920,
    "height": 1200,
    "refreshRate": 59.950001,
    "x": 1920,
    "y": 0,
    "activeWorkspace": {
        "id": 2,
        "name": "2"
    },
    "reserved": [0, 0, 0, 0],
    "scale": 1.00,
    "transform": 0,
    "focused": false,
    "dpmsStatus": true,
    "vrr": false
}]
nwg-piotr commented 1 year ago

In the latest update I turned off reading Adaptive Sync status from the wlr-randr output and started grabbing it from hyprctl instead, since wlr-randr on Slackware Linux does not return the value. Meanwhile, on your setup, for some mysterious reason, hyprctl -j monitors only sees two monitors, so we have no adaptive_sync_status value for DP-7. Are you on Thunderbolt or something like this?

I'll modify the code to use hyprctl only for adaptive_sync_status values missing from wlr-randr output.

RononDex commented 1 year ago

In the latest update I turned off reading Adaptive Sync status from the wlr-randr output and started grabbing it from hyprctl instead, since wlr-randr on Slackware Linux does not return the value. Meanwhile, on your setup, for some mysterious reason, hyprctl -j monitors only sees two monitors, so we have no adaptive_sync_status value for DP-7. Are you on Thunderbolt or something like this?

I'll modify the code to use hyprctl only for adaptive_sync_status values missing from wlr-randr output.

I think the reason why it only sees 2 monitors is because DP-7 is set to mirror eDP-1.

EDIT: Regarding your Thunderbolt question. I am connected to a docking station using USB-C, both DP screens are connected to that docking station

nwg-piotr commented 1 year ago

Wish I had every possible hardware configuration to test my stuff on. ;)

Anyway, we know whats wrong on your side. While lazying in the office I'm adding a more flexible code to get adaptive_sync_status. Will release v0.3.6 tonight, when I'm home.

RononDex commented 1 year ago

Thanks for your awesome and fast support :)

nwg-piotr commented 1 year ago

Haha! It's because of the holidays. I've been sitting in the office for 3 hours now and I haven't had anything to do yet.

RononDex commented 1 year ago

Did you already fix it? just updated my pacakges and it works again now :D

nwg-piotr commented 1 year ago

On the master branch only, no release, no packages yet. Maybe your hyprctl this time returned what it should.

nwg-piotr commented 1 year ago

Released, published in AUR.