X-Git-Url: https://git.ralfj.de/lilass.git/blobdiff_plain/c8b0a47c7d60d69e5f66048fbc166ce8df861ffc..a2545a3dcb3a2ff732b2427d4da5e08d7605455a:/dsl.py diff --git a/dsl.py b/dsl.py index d05c470..f9c0702 100755 --- a/dsl.py +++ b/dsl.py @@ -182,13 +182,13 @@ if __name__ == "__main__": try: # parse command-line arguments parser = argparse.ArgumentParser(description='easy Display Setup for Laptops') - parser.add_argument("-f, --frontend", + parser.add_argument("-f", "--frontend", dest="frontend", help="The frontend to be used for user interaction") - parser.add_argument("-r, --relative-position", + 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", + 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() @@ -236,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