--detected only list detected (available) configuration(s)
--dry-run don't change anything, only print the xrandr commands
--fingerprint fingerprint your current hardware setup
+--match-edid match diplays based on edid instead of name
--force force (re)loading of a profile / overwrite exiting files
+ --list list configurations
--skip-options <option> comma separated list of xrandr arguments (e.g. "gamma")
to skip both in detecting changes and applying a profile
--version show version information and exit
def main(argv):
try:
opts, args = getopt.getopt(argv[1:], "s:r:l:d:cfh",
- ["batch", "dry-run", "change", "default=", "save=", "remove=", "load=",
+ ["batch", "dry-run", "change", "cycle", "default=", "save=", "remove=", "load=",
"force", "fingerprint", "config", "debug", "skip-options=", "help",
- "current", "detected", "version", "match-edid"])
- "list", "current", "detected", "version"])
++ "list", "current", "detected", "version", "match-edid"])
except getopt.GetoptError as e:
print("Failed to parse options: {0}.\n"
"Use --help to get usage information.".format(str(e)),
exec_scripts(None, "predetect")
config, modes = parse_xrandr_output()
- # Sort by descending mtime
- profiles = OrderedDict(sorted(profiles.items(), key=lambda x: -x[1]["config-mtime"]))
+ if "--match-edid" in options:
+ update_profiles_edid(profiles, config)
+
++ # Sort by mtime
++ sort_direction = -1
++ if "--cycle" in options:
++ # When cycling through profiles, put the profile least recently used to the top of the list
++ sort_direction = 1
++ profiles = OrderedDict(sorted(profiles.items(), key=lambda x: sort_direction * x[1]["config-mtime"]))
+ profile_symlinks = {k: v for k, v in profile_symlinks.items() if v in (x[0] for x in virtual_profiles) or v in profiles}
+
if "--fingerprint" in options:
output_setup(config, sys.stdout)
sys.exit(0)