From: Phillip Berndt Date: Thu, 1 Dec 2022 07:30:36 +0000 (+0100) Subject: Support to skip properties using --skip-option set X-Git-Tag: 1.13~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5a6ded231f585c484a4d696ac0e641b480c4b0f8;hp=4db718e759e8a1c8cf40fba21a920669a0ed6b58;p=deb_pkgs%2Fautorandr.git Support to skip properties using --skip-option set See bug #297 and bug #299. --- 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):