+ # If there are multiple candidates, the XDG spec tells to only use the first one.
+ ran_scripts = set()
+
+ user_profile_path = os.path.expanduser("~/.autorandr")
+ if not os.path.isdir(user_profile_path):
+ user_profile_path = os.path.join(os.environ.get("XDG_CONFIG_HOME", os.path.expanduser("~/.config")), "autorandr")
+
+ for folder in chain((profile_path, os.path.dirname(profile_path), user_profile_path),