feat(ags binto): add OSD

This commit is contained in:
matt1432 2024-03-21 22:16:55 -04:00
parent 2a9ea9a4e9
commit b95ea7dde0
4 changed files with 50 additions and 7 deletions
modules/ags/config/services

View file

@ -121,10 +121,8 @@ class Brightness extends Service {
}
#monitorKbdState() {
Variable(0, {
poll: [
INTERVAL,
`brightnessctl -d ${KBD} g`,
const interval = setInterval(() => {
execAsync(`brightnessctl -d ${KBD} g`).then(
(out) => {
if (parseInt(out) !== this.#kbd) {
this.#kbd = parseInt(out);
@ -133,8 +131,10 @@ class Brightness extends Service {
return this.#kbd;
}
},
],
});
).catch(() => {
interval.destroy();
});
}, INTERVAL);
}
}