X-Git-Url: https://git.ralfj.de/lilass.git/blobdiff_plain/27d7d48deea2278c3cb593805ed8c2a7f789c0d5..467c84630b284769e555be54f2d47eecc36ed7df:/dsl.py diff --git a/dsl.py b/dsl.py index 7dc8665..2baca7d 100755 --- a/dsl.py +++ b/dsl.py @@ -188,6 +188,9 @@ if __name__ == "__main__": parser.add_argument("-r, --relative-position", dest="rel_position", choices=('left', 'right', 'external-only'), help="Position of external screen relative to internal one") + parser.add_argument("-i,--internal-only", + dest="internal_only", action='store_true', + help="Enable internal screen, disable all the others (as if no external screen was connected") cmdArgs = parser.parse_args() # load frontend @@ -205,7 +208,7 @@ if __name__ == "__main__": # check whether we got an external screen or not # Check what to do usedExternalConnector = findAvailableConnector(externalConnectors, connectors) # *the* external connector which is actually used - if usedExternalConnector is not None: + if not cmdArgs.internal_only and usedExternalConnector is not None: # there's an external screen connected, we need to get a setup if cmdArgs.rel_position is not None: # use command-line arguments (can we do this relPosition stuff more elegant?) @@ -233,6 +236,12 @@ if __name__ == "__main__": call += ["--output", name] + connectorArgs[name] print("Call that will be made:",call) subprocess.check_call(call) + + # make sure the internal screen is really, *really* turned on if requested + if cmdArgs.internal_only: + backlight = float(subprocess.check_output(["xbacklight", "-get"]).strip()) + if backlight == 0: # it's completely turned off, we better enable it + subprocess.check_call(["xbacklight", "-set", "100"]) except Exception as e: frontend.error(str(e)) raise