mirror of
https://github.com/polybar/polybar.git
synced 2024-11-11 13:50:56 -05:00
backlight: Just match amdgpu_bl prefix (#2122)
Some devices can have "amdgpu_bl1" or "amdgpu_bl2", but the code hardcoded in the value "amdgpu_bl0". This change tests based on the first characters: "amdgpu_bl".
This commit is contained in:
parent
55b7533ed1
commit
b8a1354117
1 changed files with 2 additions and 1 deletions
|
@ -51,7 +51,8 @@ namespace modules {
|
||||||
* The only sensible way is to use the 'brightness' file instead
|
* The only sensible way is to use the 'brightness' file instead
|
||||||
* Ref: https://github.com/Alexays/Waybar/issues/335
|
* Ref: https://github.com/Alexays/Waybar/issues/335
|
||||||
*/
|
*/
|
||||||
auto path_backlight_val = m_path_backlight + "/" + (card == "amdgpu_bl0" ? "brightness" : "actual_brightness");
|
std::string brightness_type = ((card.substr(0, 9) == "amdgpu_bl") ? "brightness" : "actual_brightness");
|
||||||
|
auto path_backlight_val = m_path_backlight + "/" + brightness_type;
|
||||||
|
|
||||||
m_val.filepath(path_backlight_val);
|
m_val.filepath(path_backlight_val);
|
||||||
m_max.filepath(m_path_backlight + "/max_brightness");
|
m_max.filepath(m_path_backlight + "/max_brightness");
|
||||||
|
|
Loading…
Reference in a new issue