X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=f3612cb6cca730c1d490eea1cb0924b1b7ffb247;hb=6511ee3cb3d69d0053129ce6584e65570e10f122;hp=30fa225ade5599340d27e59fe052576c8c8b69fe;hpb=59e50efac123ba8b99589d30104be2eae2f5ebed;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index 30fa225..f3612cb 100755 --- a/autorandr.py +++ b/autorandr.py @@ -1073,6 +1073,15 @@ def dispatch_call_to_sessions(argv): X11_displays_done.add(display) +def enabled_monitors(config): + monitors = [] + for monitor in config: + if "--off" in config[monitor].option_vector: + continue + monitors.append(monitor) + return monitors + + def read_config(options, directory): """Parse a configuration config.ini from directory and merge it into the options dictionary""" @@ -1178,7 +1187,7 @@ def main(argv): exec_scripts(profile_folder, "postsave", { "CURRENT_PROFILE": options["--save"], "PROFILE_FOLDER": profile_folder, - "MONITORS": ":".join(config.keys()), + "MONITORS": ":".join(enabled_monitors(config)), }) except Exception as e: raise AutorandrException("Failed to save current configuration as profile '%s'" % (options["--save"],), e) @@ -1299,7 +1308,7 @@ def main(argv): script_metadata = { "CURRENT_PROFILE": load_profile, "PROFILE_FOLDER": scripts_path, - "MONITORS": ":".join(load_config.keys()), + "MONITORS": ":".join(enabled_monitors(load_config)), } exec_scripts(scripts_path, "preswitch", script_metadata) if "--debug" in options: