nwg-piotr / nwg-displays

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

Add bitdepth functionality #35

Closed gekoke closed 3 months ago

gekoke commented 8 months ago

I'd like to specify the bitdepth for outputs using this program. Both sway and Hyprland have support for this in their configs.

nwg-piotr commented 8 months ago

I'll take a look at this soon.

nergdron commented 6 months ago

I'd love this as well, my main display supports 10bit output, and right now I have to manually edit monitors.conf to re-enable it after using nwg-displays.

nwg-piotr commented 6 months ago

We'll think about it next year. ;)

nwg-piotr commented 4 months ago

It seems we'll need some own data file, which is what I wanted to avoid. Or maybe you guys know how to check if 10-bit depth is turned on per display/monitor? Neither swaymsg -t get_outputs nor hyprctl monitors seems to return this info.

nergdron commented 4 months ago

since I use hyprland, I've filed an upstream bug for them to provide this, since I think that's probably the best solution. if someone who uses sway could do something similar, that'd be rad:

https://github.com/hyprwm/Hyprland/issues/4971

nwg-piotr commented 4 months ago

Thank you, @nergdron.

gekoke commented 4 months ago

I agree - there is no rush to make things more complicated when this can be remedied in the upstreams. These seem like sensible features to have in the clients, anyway.

nwg-piotr commented 4 months ago

As it has been already done in Hyprland, I'll add a form field soon. I only need to get us rid of wlr-randr, as vaxerski made it possible in the same commit. Either way, both changes won't work on Hyprland <= 0.36.0.

nwg-piotr commented 3 months ago

Available for testing on a branch with the misleading name no-wlr-randr. Could you take a look? Of course it requires the latest development version of Hyprland.

nergdron commented 3 months ago

@nwg-piotr will the hyprland-git package in arch get me on that dev branch, or will I have to build from source manually?

nwg-piotr commented 3 months ago

hyprland-git is what you need. :)

nergdron commented 3 months ago

perfect. i'll try to get to that soon, i'm in the middle of week 3 of covid, so i'm not exactly running at full processing power.

nwg-piotr commented 3 months ago

No hurry. We won't release this before hyprland > 0.36.0, while Arch is still on 0.35.0. Take care and get well soon.

gekoke commented 3 months ago

Awesome - thanks for your work!

nergdron commented 3 months ago

this new build doesn't run for me, crashes with the following. are we waiting on some dev release tools that aren't available in AUR yet?

Settings: {'view-scale': 0.25, 'snap-threshold': 10, 'indicator-timeout': 500, 'custom-mode': [], 'use-desc': False}
Running on Hyprland
Traceback (most recent call last):
  File "/usr/bin/nwg-displays", line 33, in <module>
    sys.exit(load_entry_point('nwg-displays==0.3.15', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 1252, in main
    create_display_buttons()
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 569, in create_display_buttons
    outputs = list_outputs()
              ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/tools.py", line 146, in list_outputs
    for item in m["availableModes"]:
                ~^^^^^^^^^^^^^^^^^^
KeyError: 'availableModes'
nwg-piotr commented 3 months ago

@nergdron Are you on Hyprland 0.37.1? The hyprctl monitors command does not return available modes in Hyprland <= 0.36.

Could you show me your hyprctl monitors output?

nergdron commented 3 months ago

aha! I had it installed, but hadn't logged out in a while. now that I'm logged in with the latest hyprland and versions of your packages, I get the following:

Traceback (most recent call last):
  File "/usr/bin/nwg-displays", line 33, in <module>
    sys.exit(load_entry_point('nwg-displays==0.3.15', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 1252, in main
    create_display_buttons()
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 577, in create_display_buttons
    item["focused"], item["monitor"], mirror=item["mirror"])
                     ~~~~^^^^^^^^^^^
KeyError: 'monitor'

my current monitors.conf looks like this:

monitor=DP-2,highrr,0x0,1.25,bitdepth,10,vrr,1
monitor=DP-3,disabled
monitor=HDMI-A-1,preferred,0x0,1.0,mirror,DP-2

if it's the highrr messing things up, I had to add that since I just got a 240Hz monitor, and the normal preferred setting was defaulting to 60Hz for some strange reason.

in any case, if you can identify what it's breaking on, I'm happy to open a new ticket about it. no rush.

nwg-piotr commented 3 months ago

The disabled one is what crashes the program. I'll fix it tonight.

nwg-piotr commented 3 months ago

The crash on the 'monitor' key has been reported in #54. Let's continue up there.