mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-11-13 13:19:09 +01:00
made the fetching of the brightness device agnostic
This commit is contained in:
1 parent
41446d8536
commit
1c98522beb
1 file changed
+2
-2
@@ -148,8 +148,8 @@ const getBattery = async () => {
|
||||
};
|
||||
|
||||
const getBrightness = async () => {
|
||||
return execute("cat /sys/class/backlight/intel_backlight/brightness").then(brightness => {
|
||||
const brightnessLevel = Math.round((Number(brightness.toString().trim()) || 0) / 1000);
|
||||
return execute("/usr/bin/cat /sys/class/backlight/*/brightness").then(brightness => {
|
||||
const brightnessLevel = Number(brightness.trim()) || 0;
|
||||
|
||||
return ` ${brightnessLevel}%`;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user