nwg-piotr / nwg-displays

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

Crash during launch with VR headset: KeyError: 'physical-width' #47

Closed tristanbeedell closed 2 months ago

tristanbeedell commented 4 months ago
Traceback (most recent call last):
  File "/nix/store/8xyhz1bqxnss3ax655zvcgmliq509400-nwg-displays-0.1.4/bin/.nwg-displays-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/8xyhz1bqxnss3ax655zvcgmliq509400-nwg-displays-0.1.4/lib/python3.11/site-packages/nwg_displays/main.py", line 1229, in main
    create_display_buttons()
  File "/nix/store/8xyhz1bqxnss3ax655zvcgmliq509400-nwg-displays-0.1.4/lib/python3.11/site-packages/nwg_displays/main.py", line 552, in create_display_buttons
    b = DisplayButton(key, item["description"], item["x"], item["y"], round(item["physical-width"]),
                                                                            ~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'physical-width'

I am running NixOS, Hyprland latest (v0.35.0) (from git / nix flake) and tested with the latest version of nwg-displays from this git repo (using the nix flake).

I have determined that this issue is caused by my Valve Index VR Headset being connected:

DP-2 {'active': False, 'modes': [{'width': 2880, 'height': 1600, 'refresh': 90002.998}, {'width': 2880, 'height': 1600, 'refresh': 144000.0}, {'width': 2880, 'height': 1600, 'refresh': 120018.997}, {'width': 2880, 'height': 1600, 'refresh': 79999.001}, {'width': 1920, 'height': 1200, 'refresh': 90002.998}, {'width': 1920, 'height': 1080, 'refresh': 90002.998}, {'width': 1600, 'height': 1200, 'refresh': 90002.998}, {'width': 1680, 'height': 1050, 'refresh': 90002.998}, {'width': 1280, 'height': 1024, 'refresh': 90002.998}, {'width': 1440, 'height': 900, 'refresh': 90002.998}, {'width': 1280, 'height': 800, 'refresh': 90002.998}, {'width': 1280, 'height': 720, 'refresh': 90002.998}, {'width': 1024, 'height': 768, 'refresh': 90002.998}, {'width': 800, 'height': 600, 'refresh': 90002.998}, {'width': 640, 'height': 480, 'refresh': 90002.998}], 'scale_filter': None, 'dpms': True, 'mirror': '', 'monitor': None, 'focused': False, 'adaptive_sync_status': 'disabled', 'description': 'Valve Corporation Index HMD 0x63AF4FCC', 'x': 0, 'y': 0, 'logical-width': 0, 'logical-height': 0, 'transform': 'normal', 'scale': 1.0, 'model': 'Index HMD'}

interestingly, after disconnecting this device and reconnecting it, it contained slightly less info:

DP-2 {'active': False, 'focused': False, 'adaptive_sync_status': 'disabled', 'description': 'Valve Corporation Index HMD 0x63AF4FCC', 'x': -1, 'y': -1, 'logical-width': 0, 'logical-height': 0, 'transform': 'normal', 'scale': 1.0, 'dpms': True, 'model': 'Index HMD'}

This device will of course never be part of the desktop, so doesn't necessarily need to be recognised by nwg-displays at all, so ignoring this error and continuing would actually be a fine solution for me.

Upon disconnecting this device, the application launches and functions great 👍

Ciflire commented 3 months ago

Same issue here but with secondary display. I don't know where that comes from

nwg-piotr commented 3 months ago

Which version are you on? It shouldn't happen on 0.3.16.

nwg-piotr commented 2 months ago

Closing due to no further feedback.