Bladeren bron

added flag --no-backlight

Fabian Peter Hammerle 7 jaren geleden
bovenliggende
commit
6b9e5af3e5
2 gewijzigde bestanden met toevoegingen van 13 en 2 verwijderingen
  1. 5 0
      README.md
  2. 8 2
      scripts/xrandrl

+ 5 - 0
README.md

@@ -26,6 +26,7 @@ optional arguments:
   -d, --disabled   disabled only (does not imply --connected)
   -e, --enabled    enabled only (does not imply --connected)
   -b, --backlight  outputs with backlight configurable via randr only
+  -B, --no-backlight  outputs without backlight configurable via randr only
   -h, --help       show help message and exit
 ```
 
@@ -47,6 +48,10 @@ DP2-1
 $ xrandrl --backlight
 eDP2
 
+$ xrandrl --no-backlight --connected
+DP2-1
+DP2-2
+
 $ xrandrl
 eDP2
 DP1

+ 8 - 2
scripts/xrandrl

@@ -196,7 +196,7 @@ class RandrOutputInfo:
             return False
 
 
-def process(connected, disabled, enabled, backlight):
+def process(connected, disabled, enabled, backlight, no_backlight):
     xdisplay = X11.XOpenDisplay(None)
     screen_resrcs = RandrScreenResources(
         xdisplay,
@@ -206,7 +206,8 @@ def process(connected, disabled, enabled, backlight):
         if ((not connected or output_info.connected)
                 and (not disabled or not output_info.enabled)
                 and (not enabled or output_info.enabled)
-                and (not backlight or output_info.has_backlight())):
+                and (not backlight or output_info.has_backlight())
+                and (not no_backlight or not output_info.has_backlight())):
             print(output_info.name)
     X11.XCloseDisplay(xdisplay)
 
@@ -236,6 +237,11 @@ def _init_argparser():
         action='store_true',
         help='outputs with backlight configurable via randr only',
     )
+    argparser.add_argument(
+        '-B', '--no-backlight',
+        action='store_true',
+        help='outputs without backlight configurable via randr only',
+    )
     return argparser