mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
more elegant amd fix
This commit is contained in:
parent
e4756cf24e
commit
9fa0eb7068
@ -213,7 +213,9 @@ void waybar::modules::Backlight::upsert_device(ForwardIt first, ForwardIt last,
|
|||||||
const char *name = udev_device_get_sysname(dev);
|
const char *name = udev_device_get_sysname(dev);
|
||||||
check_nn(name);
|
check_nn(name);
|
||||||
|
|
||||||
const char *actual = udev_device_get_sysattr_value(dev, "actual_brightness");
|
const char *actual_brightness_attr = strcmp(name, "amdgpu_bl0") == 0 ? "brightness" : "actual_brightness";
|
||||||
|
|
||||||
|
const char *actual = udev_device_get_sysattr_value(dev, actual_brightness_attr);
|
||||||
check_nn(actual);
|
check_nn(actual);
|
||||||
const int actual_int = std::stoi(actual);
|
const int actual_int = std::stoi(actual);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user