From: Phillip Berndt Date: Sun, 10 Mar 2019 12:57:32 +0000 (+0100) Subject: Improve error message if a profile configures an output that doesn't exist (See ... X-Git-Tag: 1.8~1 X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fautorandr.git;a=commitdiff_plain;h=9929130fe5d0441a7d4ffd9ee35162f1004136c9 Improve error message if a profile configures an output that doesn't exist (See #142) --- diff --git a/autorandr.py b/autorandr.py index c108c26..04fda8f 100755 --- a/autorandr.py +++ b/autorandr.py @@ -708,6 +708,9 @@ def apply_configuration(new_configuration, current_configuration, dry_run=False) if not new_configuration[output].edid or "off" in new_configuration[output].options: disable_outputs.append(new_configuration[output].option_vector) else: + if output not in current_configuration: + raise AutorandrException("New profile configures output %s which does not exist in current xrandr --verbose output. " + "Don't know how to proceed." % output) if "off" not in current_configuration[output].options: remain_active_count += 1