mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 16:52:12 +02:00
made the fetching of the brightness device agnostic
This commit is contained in:
@@ -148,8 +148,8 @@ const getBattery = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getBrightness = async () => {
|
const getBrightness = async () => {
|
||||||
return execute("cat /sys/class/backlight/intel_backlight/brightness").then(brightness => {
|
return execute("/usr/bin/cat /sys/class/backlight/*/brightness").then(brightness => {
|
||||||
const brightnessLevel = Math.round((Number(brightness.toString().trim()) || 0) / 1000);
|
const brightnessLevel = Number(brightness.trim()) || 0;
|
||||||
|
|
||||||
return ` ${brightnessLevel}%`;
|
return ` ${brightnessLevel}%`;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user