diff --git a/led_system_monitor.py b/led_system_monitor.py index 7788d8e..a69fad2 100644 --- a/led_system_monitor.py +++ b/led_system_monitor.py @@ -15,9 +15,9 @@ if __name__ == "__main__": # Right LED Matrix location: "1-3.3" # Set up monitors and serial for left LED Matrix - min_background_brightness = 8 + min_background_brightness = 12 max_background_brightness = 35 - min_foreground_brightness = 30 + min_foreground_brightness = 24 max_foreground_brightness = 160 cpu_monitor = CPUMonitor() diff --git a/monitors.py b/monitors.py index bfaff81..d5f93fa 100644 --- a/monitors.py +++ b/monitors.py @@ -129,6 +129,12 @@ def get_monitor_brightness(): if os.name == 'nt': return wmi.WMI(namespace='wmi').WmiMonitorBrightness()[0].CurrentBrightness / 100.0 else: - return int(open('/sys/class/backlight/amdgpu_bl1/brightness', 'r').read()) / 255.0 + try: # First try the dGPU brightness + return int(open('/sys/class/backlight/amdgpu_bl2/brightness', 'r').read()) / 255.0 + except: # If that doesn't work, try the iGPU brightness + return int(open('/sys/class/backlight/amdgpu_bl1/brightness', 'r').read()) / 255.0 except Exception as e: return 1.0 + +if __name__ == "__main__": + print(get_monitor_brightness()) \ No newline at end of file