add brightness to xob

This commit is contained in:
Guilherme Rugai Freire 2026-03-27 11:48:07 -03:00
parent c47fd16c5e
commit eda2e3d871
No known key found for this signature in database
GPG Key ID: DCFA7949937FB2CD
4 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,6 @@
#!/bin/bash
inotifywait -m -q -e modify /sys/class/backlight/intel_backlight/brightness |
while read -r; do
./brightness_pct.sh
done

5
.config/xob/brightness.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
cd "${0%/*}" || exit
./brightness-watcher.sh | xob -s brightness

6
.config/xob/brightness_pct.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
max=$(cat /sys/class/backlight/intel_backlight/max_brightness)
curr=$(cat /sys/class/backlight/intel_backlight/brightness)
echo "$curr*100/$max" | bc

View File

@ -37,3 +37,43 @@ volume = {
}; };
}; };
}; };
brightness = {
thickness = 20;
outline = 2;
border = 3;
padding = 1;
orientation = "vertical";
x = {
relative = 0;
offset = 24;
}
y = {
relative = 0.5;
offset = 0;
}
color = {
normal = {
fg = "#49659C";
bg = "#272A34";
border = "#49659C";
};
alt = {
fg = "#363D54";
bg = "#272A34";
border = "#49659C";
};
overflow = {
fg = "#900000";
bg = "#272A34";
border = "#933333";
};
altoverflow = {
fg = "#900000";
bg = "#272A34";
border = "#49659C";
};
};
};