]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Support to skip properties using --skip-option set
authorPhillip Berndt <phillip.berndt@googlemail.com>
Thu, 1 Dec 2022 07:30:36 +0000 (08:30 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Thu, 1 Dec 2022 07:33:46 +0000 (08:33 +0100)
See bug #297 and bug #299.

README.md
autorandr.py

index 8436897a1186de3ec411540ef29615e41ccd22ef..d17e8dabaf56b077ac98f4572f0b940b6c2f8028 100644 (file)
--- 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)
 
index 0d80bc4da2c4164037f8c8c521c98c16a24cd83d..9f302440e89058edd89d63cd7bc56f2cdac0614d 100755 (executable)
@@ -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):