+ # how do we filter the RelativeScreenPosition for the CLI?
+ relPosFilter = str.lower
+
+ # parse command-line arguments
+ parser = argparse.ArgumentParser(description='easy Display Setup for Laptops')
+ parser.add_argument("-f", "--frontend",
+ dest="frontend",
+ help="The frontend to be used for user interaction")
+ parser.add_argument("-r", "--relative-position",
+ dest="rel_position", choices=list(map(relPosFilter, screen.RelativeScreenPosition.__members__.keys())),
+ help="Set the position of external screen relative to internal one.")
+ parser.add_argument("-e", "--external-only",
+ dest="external_only", action='store_true',
+ help="If an external screen is connected, disable all the others.")
+ parser.add_argument("-i", "--internal-only",
+ dest="internal_only", action='store_true',
+ help="Enable internal screen, disable all the others.")
+ cmdArgs = parser.parse_args()
+
+ # load frontend early (for error mssages)
+ frontend = gui.getFrontend(cmdArgs.frontend)
+
+ # load configuration
+ config = loadConfigFile(os.getenv('HOME') + '/.dsl.conf')
+