Skip to content

Commit

Permalink
Fix dictionary name on Brightness
Browse files Browse the repository at this point in the history
  • Loading branch information
bkbilly committed Jan 8, 2024
1 parent 501f718 commit c2d7ead
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lnxlink/modules/brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def start_control(self, topic, data):
f"xrandr --output {values['name']} --brightness {data} {disp_env_cmd}"
)
else:
display = self.displays[topic[1].replace("brightness_", "")]["name"]
display = self.displays[
topic[1].replace("brightness_", "").replace("-", "_")
]["name"]
syscommand(f"xrandr --output {display} --brightness {data} {disp_env_cmd}")

def _get_displays(self):
Expand All @@ -86,7 +88,7 @@ def _get_displays(self):
)

for match in pattern.findall(stdout):
displays[match[0].lower()] = {
displays[match[0].replace("-", "_").lower()] = {
"name": match[0],
"brightness": float(match[1]),
}
Expand Down

0 comments on commit c2d7ead

Please sign in to comment.