Skip to content

Commit

Permalink
fix: gather closeness score for all outputs
Browse files Browse the repository at this point in the history
defined in a given profile.

BREAKING CHANGE: profiles are now scored on the EDID matches of *all* of
their outputs, rather than just the EDID match of their last output
(where "last" means "final element in `profile["config"].keys()`").
  • Loading branch information
tomeon committed Sep 27, 2023
1 parent c0dfe7d commit b225760
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions autorandr.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,14 @@ def find_profiles(current_config, profiles):
percent_present_in_profile = len(possible_output_names) / len(current_output_names)
percent_present_in_current_config = len(enabled_output_names) / len(possible_output_names)

closeness = max(match_asterisk(output.edid, current_config[name].edid), match_asterisk(
current_config[name].edid, output.edid))
closeness = 1
for name in profile_output_names:
output = config[name]

output_closeness = max(match_asterisk(output.edid, current_config[name].edid), match_asterisk(
current_config[name].edid, output.edid))

closeness *= output_closeness

detected_profiles.append({
'profile_name': profile_name,
Expand Down

0 comments on commit b225760

Please sign in to comment.