From 5a6ded231f585c484a4d696ac0e641b480c4b0f8 Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Thu, 1 Dec 2022 08:30:36 +0100 Subject: [PATCH] Support to skip properties using --skip-option set See bug #297 and bug #299. --- README.md | 3 +++ autorandr.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8436897..d17e8da 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,9 @@ options nvidia_drm modeset=1 ## Changelog +**autorandr 1.13 (dev)** +* *2022-12-01* Support `--skip-option set` to skip setting properties + **autorandr 1.12.1** * *2021-12-22* Fix `--match-edid` (see #273) diff --git a/autorandr.py b/autorandr.py index 0d80bc4..9f30244 100755 --- a/autorandr.py +++ b/autorandr.py @@ -257,12 +257,17 @@ class XrandrOutput(object): if xrandr_version() >= Version("1.2"): options.update(self.XRANDR_12_DEFAULTS) options.update(self.options) + if "set" in self.ignored_options: + options = {a: b for a, b in options.items() if not a.startswith("x-prop")} return {a: b for a, b in options.items() if a not in self.ignored_options} @property def filtered_options(self): "Return a dictionary of options without ignored options" - return {a: b for a, b in self.options.items() if a not in self.ignored_options} + options = {a: b for a, b in self.options.items() if a not in self.ignored_options} + if "set" in self.ignored_options: + options = {a: b for a, b in options.items() if not a.startswith("x-prop")} + return options @property def option_vector(self): -- 2.39.2