nwg-piotr / nwg-displays

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

Check `output_path` exists before reading in backup #40

Closed curz46 closed 6 months ago

curz46 commented 6 months ago
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 519, in on_apply_button
    apply_settings(display_buttons, outputs_activity, outputs_path, use_desc=config["use-desc"])
  File "/usr/lib/python3.11/site-packages/nwg_displays/main.py", line 834, in apply_settings
    backup = load_text_file(outputs_path).splitlines()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'splitlines'

Steps to reproduce

  1. Delete $HOME/sway/outputs or equivalent output_path for the window manager in use.
  2. Launch nwg-displays via command-line and press apply.
  3. Observe that the UI does not update. In the console, observe the AttributeError due to file not found.