Giter Site home page Giter Site logo

nwg-displays's Introduction

Hi, I’m Piotr - a middle-aged clerk and after-hours FOSS developer. I’m interested in Linux, Wayland & GTK.

  • I use sway and Hyprland on Arch Linux;
  • I have been working on the GTK shell for sway and Hyprland called nwg-shell;
  • I prefer python to shell scripting and golang to C.

How to reach me:

  • Join the nwg-shell Discussions, or
  • submit an issue on GitHub on the appropriate project page, or
  • find me in the nwg-shell Matrix space, or
  • drop me a line by email.

Do not invite me to a live chat, unless you have diction like sir John Vincent Hurt. I'm quite useless at listening to English.

If you'd like to buy me a coffee, you may use GitHub Sponsors (link in the left column) or Liberapay:

Donate using Liberapay

nwg-displays's People

Contributors

6543 avatar curz46 avatar dasenb avatar dydyamotya avatar fishyg avatar jamesbucher avatar k0ral avatar lamprospitsillos avatar matejc avatar mauricekraus avatar mikewalrus avatar nwg-piotr avatar sunderland93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nwg-displays's Issues

Displays overlap

I have an internal display (eDP-1) and an external display (DP-5). Both displays are 1920x1080 with scale 1.33. When I snap them together in nwg-displays the positions are incorrect and there is a slight overlap that causes the mouse pointer to be mirrored on both displays temporarily before jumping to the next screen when it reaches the edge.

First display is DP-5, which starts at position 0,0:

2022-03-23T16:01:34,334635825+03:00-fs8

Second display is eDP-1, which starts at 1086,0 when I snap it to DP-5:

2022-03-23T16:10:34,403356356+03:00-fs8

If I manually drag eDP-5 to 1445,0 the transition between displays works as expected.
2022-03-23T16:02:30,386353292+03:00-fs8

I guess this is a problem with the fractional scaling math? I am using nwg-displays 0.1.2 on Arch Linux and Sway 1.7. Thank you!

Missing Dependency

Hello,

I installed nwg-displays on my arch just now and upon launch was greeted with the message wlr-randr package required, but not found, terminating.. After installing wlr-randr the tool worked just fine.

From what I can see, it seems that wlr-randr should be included in the package's dependencies list to avoid future manual intervention.

Thanks for developing this tool,

Best

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

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 👍

Set output file for hyprland

nwg-displays has an option -o to define the output file for sway. However, there should also be one for hyprland which would allow us to use our own config structure

Error when workspaces.conf is missing

When the workspaces button is clicked, nwg-display just assumes there is a workspaces.conf under $HOME/.config/hypr/ which was not true for me.

Error parsing workspaces.conf file: [Errno 2] No such file or directory: '/home/user/.config/hypr/workspaces.conf'
WS->Mon: ({}, {})
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 666, in create_workspaces_window_hypr
    old_workspaces = workspaces.copy()
                     ^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'copy'

Add bitdepth functionality

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

Popup + countdown to prevent incorrect configuration

I accidentally changed my refresh rate to 59 instead of 60. My monitor instantly turned dark and I had to manually fix it via tty login.

Other display tools such as gnome, kde and Windows Display Settings offer a countdown mechanism that resets the display settings after 20 seconds if the user do not press apply again. Can you add such a feature to nwg-displays?

traceback- crash on hyprland - nwg-displays-0.3.4

Running on Hyprland
LVDS-1 {'description': 'Apple Computer Inc Color LCD', 'active': True, 'focused': False, 'modes': [{'width': 1280, 'height': 800, 'refresh': 60223.0}], 'scale_filter': None, 'dpms': None, 'mirror': '', 'monitor': <gi.GdkWaylandMonitor object at 0x7fd61436a440 (GdkWaylandMonitor at 0x230d970)>, 'physical-width': 1280, 'physical-height': 800, 'refresh': 60.223, 'x': 0, 'y': 0, 'transform': 'normal', 'scale': 1.0, 'logical-width': 1280.0, 'logical-height': 800.0}
Traceback (most recent call last):
File "/usr/bin/nwg-displays", line 33, in
sys.exit(load_entry_point('nwg-displays==0.3.4', 'gui_scripts', 'nwg-displays')())
File "/usr/lib64/python3.9/site-packages/nwg_displays/main.py", line 1002, in main
create_display_buttons()
File "/usr/lib64/python3.9/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'

Executing nwg-displays 0.3.4 on Hyprland results in this for me. nwg-displays operates normally on sway.

[Feature Request] Multiple output configurations?

First of all, thank you for this amazing tool! It really makes my life a lot easier (or at least faster) when working in Sway!

I am regularly working with multiple different setups, depending on where I am:

  • Two external monitors
  • Single portable monitor
  • Only integrated laptop screen

Unfortunately, I always have to set up my monitor layout from start after I've switched locations, which is kind of annoying.

Is there any way to remember various configurations and apply them automatically based on the detected external monitors (or lack thereof)? As far as I can remember, KDE Plasma did this automatically, so there should be way to do this in other environments as well.

One solution I can think of immediately would be a Rofi-based switcher that loads the respective output configuration file in Sway. However, there might be a better and more automated solution?

[feature] change screen resolution like Chrome OS

ChromeOS has following feature https://support.google.com/chromebook/answer/183101?hl=en

Action Hot key
Change screen resolution Shift + Ctrl and + or - (minus)
Reset screen resolution to default Shift + Ctrl + 0
Rotate screen 90 degrees Shift + Ctrl + Rotate

Actually, it change SCALE (not resolution)

Can we add command like below to set it dynamic by bind hotkeys? It will be awesome

nwg-displays set-scale +0.2
nwg-displays set-scale 1
nwg-displays transform ...

The command only effect to focused display

If there is only one output, it must be enabled automatically

When there is only one output available, disabling it makes no sense and leaves you with an unusable black screen until connect ing another display.
This happens easily when using a laptop connected to an external monitor and with the laptop screen disabled.
The expected behaviour would be that the laptop screen is enabled automatically when disconnecting the external screen.

[ERROR] ModuleNotFoundError: No module named 'gi'

Hello there,
I just installed nwg-displays on my Arch by launching install.sh.
When I try to launch the tool, I receive an error:

❯ nwg-displays
Traceback (most recent call last):
  File "/home/<user>/.venv/bin/nwg-displays", line 33, in <module>
    sys.exit(load_entry_point('nwg-displays==0.3.10', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<user>/.venv/bin/nwg-displays", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/<user>/.venv/lib/python3.11/site-packages/nwg_displays-0.3.10-py3.11.egg/nwg_displays/main.py", line 20, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'

I tried to install all of these but no change.
Can I get a little help? :)

nwg-displays 0.3.10-1 dies in list_outputs when display is disabled

just trying out nwg on hyprland, and I mostly love it. definitely makes things a lot easier to configure and deal with. however, on my arch install of version 0.3.10-1 of nwg-displays, I disabled a display output (my VR headset, which shouldn't be active all the time), and now nwg-displays just crashes when I try to launch it, so I can't do any further display configuration:

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.10', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 1224, in main
    create_display_buttons()
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 548, in create_display_buttons
    outputs = list_outputs()
              ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/tools.py", line 186, in list_outputs
    if int(outputs_dict[key]["x"]) == geometry.x and int(outputs_dict[key]["y"]) == geometry.y:
           ~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'x'

any theory on what's going on, and how I might modify things so that the VR headset remains disabled but I can still use the app?

Feature: option to use `desc: Monitor` instead of port name

Thanks for nwg-displays. This might be a hyprland specific wish, but it would be nice to have the option to use the monitors' description instead of the port name.
The background is that I have multiple workplaces with different monitor setups. Using the description would make using different setups more robust.

workspaces.conf location should follow monitors.conf since they are complementary

monitors.conf location can be specified by -m flag. However, workspaces.conf is still using the default location and it is not configurable. I think it should either follow monitors.conf or has its own customizable path.

nwg-displays -m ~/.local/share/hypr/monitors.conf

Error parsing workspaces.conf file: [Errno 2] No such file or directory: '/home/USERNAME/.config/hypr/workspaces.conf'
WS->Mon: ({}, {})
Traceback (most recent call last):
  File "/nix/store/jswzg6ad04gj68qppwkkjc67x7r4nc7z-nwg-displays-0.3.8/lib/python3.10/site-packages/nwg_displays/main.py", line 667, in create_workspaces_window_hypr
    old_workspaces = workspaces.copy()
AttributeError: 'tuple' object has no attribute 'copy'

Kind request: RPM package

Could we have an RPM package? I would make it much easier to stay up to date on RedHat-based Linuxes

KeyError: 'availableModes'

I use the nwg-shell installed on Manjaro with Hyprland. When running nwg-displays in the terminal I get following error:

Settings: {'view-scale': 0.15, '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.16', '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'

Currently running version 0.3.16

If I need to supply more information please let me know.

Missing input in nix flake?

Running on Hyprland
wlr-randr package required, but not found, terminating.

I installed on my NixOs machine running unstable channel and got the above error.
Maybe it should be added to the nix file as an input/dependency ?

Not working with Hyprland headless displays

Steps to reproduce:

  1. Create a headless display with hyprctl output create headless (as found in Hyprland Wiki)
  2. Run nwg-displays via terminal
  3. The following error gets returned:
Console
Settings: {'view-scale': 0.15, '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.14', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 1243, in main
    create_display_buttons()
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 559, in create_display_buttons
    outputs = list_outputs()
              ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/tools.py", line 138, in list_outputs
    "refresh": float(parts[2]) * 1000}
               ^^^^^^^^^^^^^^^
ValueError: could not convert string to float: '(current)'

Kanshi Support

Hey this looks great.

It would be cool if this tool could generate kanshi profiles.

If you do that then if you save a config as a profile in kanshi config, then of you dock or move to a different desk then kanshi will detect the profile and automatically switch for you.

GURU ebuild does not work

The ebuild installs just fine, but I receive this error. I already tried installing gtk-layer-shell but it does not work. Is there a dependency missing or is the ebuild not setup correctly? Here is the output:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 24, in <module>
    gi.require_version('GtkLayerShell', '0.1')
  File "/usr/lib/python3.11/site-packages/gi/__init__.py", line 126, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GtkLayerShell not available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/nwg-displays", line 5, in <module>
    from nwg_displays.main import main
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 26, in <module>
    raise RuntimeError('\n\n' +
RuntimeError: 

If you haven't installed GTK Layer Shell, you need to point Python to the
library by setting GI_TYPELIB_PATH and LD_LIBRARY_PATH to <build-dir>/src/.
For example you might need to run:

GI_TYPELIB_PATH=build/src LD_LIBRARY_PATH=build/src python3 /usr/lib/python-exec/python3.11/nwg-displays
➜  ~ 

Crash on Start after update

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'

Crash during launch with Hyprland v0.35 KeyError: 'physical-width' and with Hyprland v0.37.1 KeyError: 'monitor'

OS: Arch
WM: Hyprland v0.35

Monitor config in Hyprland:

# Mirror Display
monitor=eDP-1,preferred,auto,1
monitor=DP-2,preferred,auto,1,mirror,eDP-1

hyprctl monitors all

Monitor eDP-1 (ID 0):
	[email protected] at 0x0
	description: Lenovo Group Limited 0x40B2 (eDP-1)
	make: Lenovo Group Limited
	model: 0x40B2
	serial: 
	active workspace: 5 (5)
	special workspace: 0 ()
	reserved: 0 32 0 30
	scale: 1.00
	transform: 0
	focused: yes
	dpmsStatus: 1
	vrr: 0
	activelyTearing: false

Monitor DP-2 (ID 1):
	[email protected] at 0x0
	description: Sony SONY TV 0x01010101 (DP-2)
	make: Sony
	model: SONY TV
	serial: 0x01010101
	active workspace: -1 ()
	special workspace: 0 ()
	reserved: 0 0 0 0
	scale: 1.00
	transform: 0
	focused: no
	dpmsStatus: 1
	vrr: 0
	activelyTearing: false

wlr-randr

DP-2 "Sony SONY TV 0x01010101 (DP-2)"
  Make: Sony
  Model: SONY TV
  Serial: 0x01010101
  Physical size: 1600x900 mm
  Enabled: no
  Modes:
    1920x1080 px, 60.000000 Hz (preferred)
    1920x1080 px, 59.938999 Hz
    1920x1080 px, 50.000000 Hz
    1920x1080 px, 29.972000 Hz
    1920x1080 px, 23.976999 Hz
    1680x1050 px, 59.953999 Hz
    1600x900 px, 60.000000 Hz
    1280x1024 px, 60.020000 Hz
    1152x864 px, 75.000000 Hz
    1280x720 px, 60.000000 Hz
    1280x720 px, 59.943001 Hz
    1280x720 px, 50.000000 Hz
    1280x720 px, 29.972000 Hz
    1280x720 px, 23.976000 Hz
    1024x768 px, 60.004002 Hz
    800x600 px, 60.317001 Hz
    720x576 px, 50.000000 Hz
    720x480 px, 59.939999 Hz
    640x480 px, 59.939999 Hz
    640x480 px, 59.929001 Hz
    0x0 px
eDP-1 "Lenovo Group Limited 0x40B2 (eDP-1)"
  Make: Lenovo Group Limited
  Model: 0x40B2
  Serial: (null)
  Physical size: 340x190 mm
  Enabled: yes
  Modes:
    1920x1080 px, 60.004002 Hz (preferred, current)
    1920x1080 px, 50.001999 Hz
  Position: 0,0
  Transform: normal
  Scale: 1.000000
  Adaptive Sync: disabled

Trying to manually enable DP-2 causes Hyprland to crash and takes me back to SDDM login screen

wlr-randr --dry-run --output DP-2 --on
OR
wlr-randr --output DP-2 --on

Finally,
nwg-displays

Settings: {'view-scale': 0.15, 'snap-threshold': 10, 'indicator-timeout': 500, 'custom-mode': [], 'use-desc': False}
Running on Hyprland
eDP-1 {'active': True, 'modes': [{'width': 1920, 'height': 1080, 'refresh': 60004.002}, {'width': 1920, 'height': 1080, 'refresh': 50001.998999999996}], 'scale_filter': None, 'dpms': True, 'mirror': '', 'monitor': <__gi__.GdkWaylandMonitor object at 0x728de19d9ac0 (GdkWaylandMonitor at 0x5d322cb0ab60)>, 'physical-width': 1920, 'physical-height': 1080, 'refresh': 60.004002, 'adaptive_sync_status': 'disabled', 'focused': True, 'description': 'Lenovo Group Limited 0x40B2 ', 'x': 0, 'y': 0, 'logical-width': 1920, 'logical-height': 1080, 'transform': 'normal', 'scale': 1.0, 'model': '0x40B2'}
DP-2 {'active': False, 'modes': [{'width': 1920, 'height': 1080, 'refresh': 60000.0}, {'width': 1920, 'height': 1080, 'refresh': 59938.999}, {'width': 1920, 'height': 1080, 'refresh': 50000.0}, {'width': 1920, 'height': 1080, 'refresh': 29972.0}, {'width': 1920, 'height': 1080, 'refresh': 23976.999}, {'width': 1680, 'height': 1050, 'refresh': 59953.999}, {'width': 1600, 'height': 900, 'refresh': 60000.0}, {'width': 1280, 'height': 1024, 'refresh': 60020.0}, {'width': 1152, 'height': 864, 'refresh': 75000.0}, {'width': 1280, 'height': 720, 'refresh': 60000.0}, {'width': 1280, 'height': 720, 'refresh': 59943.001000000004}, {'width': 1280, 'height': 720, 'refresh': 50000.0}, {'width': 1280, 'height': 720, 'refresh': 29972.0}, {'width': 1280, 'height': 720, 'refresh': 23976.0}, {'width': 1024, 'height': 768, 'refresh': 60004.002}, {'width': 800, 'height': 600, 'refresh': 60317.001}, {'width': 720, 'height': 576, 'refresh': 50000.0}, {'width': 720, 'height': 480, 'refresh': 59939.999}, {'width': 640, 'height': 480, 'refresh': 59939.999}, {'width': 640, 'height': 480, 'refresh': 59929.001}], 'scale_filter': None, 'dpms': True, 'mirror': '', 'monitor': None, 'focused': False, 'adaptive_sync_status': 'disabled', 'description': 'Sony SONY TV 0x01010101', 'x': 0, 'y': 0, 'logical-width': 1920, 'logical-height': 1080, 'transform': 'normal', 'scale': 1.0, 'model': 'SONY TV'}
Traceback (most recent call last):
  File "/usr/bin/nwg-displays", line 33, in <module>
    sys.exit(load_entry_point('nwg-displays==0.3.14', 'gui_scripts', 'nwg-displays')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 1243, in main
    create_display_buttons()
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 563, in create_display_buttons
    b = DisplayButton(key, item["description"], item["x"], item["y"], round(item["physical-width"]),
                                                                            ~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'physical-width'

System information (inxi -Faz) is attached.
system_info.txt
Let me know what other information you need. Thank you.

gui not starting

(nwg-displays:43104): Gtk-WARNING **: 00:42:33.401: Theme parsing error: gtk.css:6616:68: Invalid name of pseudo-class

Add generated comment

The files generated by this tool should contain a comment like this:

# This file was generated by nwg-display at 2023-06-25 11:45

Unable to set precise fractional scaling for display

My sway/kanshi config has each of my displays at a scale factor of 1.33, but when I try to set the same in nwg-displays it reverts to 1.3 when I apply the settings. I'm not sure if it is actually applying the 1.33 scale and rounding down in the UI, or if it's actually unable to use values such as 1.33.

nwg-version 0.1.2.

"Apply" not applying settings

Hi, when using Hyprland, the Settings are not applied for me, unless i press keep and manually reload the hyprland config. Is this intended behavior?

--generic_names option

Hi,
I think the README is outdated, there is an extra argument --generic_names that is not available anymore. Is it equivalent to the "[ ] Use description" checkbox in the GUI?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.