* Adrián López
* andersonjacob
* Alexander Wirt
+* Brice Waegeneire
* Chris Dunder
* Christoph Gysin
* Daniel Hahler
is executed instead of the `mobile` specific `postswitch`.
In these scripts, some of autorandr's state is exposed as environment variables
-prefixed with `AUTORANDR_`. The most useful one is `$AUTORANDR_CURRENT_PROFILE`.
+prefixed with `AUTORANDR_`, such as:
+- `AUTORANDR_CURRENT_PROFILE`
+- `AUTORANDR_CURRENT_PROFILES`
+- `AUTORANDR_PROFILE_FOLDER`
+- `AUTORANDR_MONITORS`
If you experience issues with xrandr being executed too early after connecting
a new monitor, then you can use a `predetect` script to delay the execution.
try:
profile_folder = os.path.join(profile_path, options["--save"])
save_configuration(profile_folder, config)
- exec_scripts(profile_folder, "postsave", {"CURRENT_PROFILE": options["--save"], "PROFILE_FOLDER": profile_folder})
+ exec_scripts(profile_folder, "postsave", {
+ "CURRENT_PROFILE": options["--save"],
+ "PROFILE_FOLDER": profile_folder,
+ "MONITORS": ":".join(load_config.keys()),
+ })
except Exception as e:
raise AutorandrException("Failed to save current configuration as profile '%s'" % (options["--save"],), e)
print("Saved current configuration as profile '%s'" % options["--save"])
script_metadata = {
"CURRENT_PROFILE": load_profile,
"PROFILE_FOLDER": scripts_path,
+ "MONITORS": ":".join(load_config.keys()),
}
exec_scripts(scripts_path, "preswitch", script_metadata)
if "--debug" in options: