nixos-configs/devices/wim/config/ags/js/osd/kbd.js

29 lines
779 B
JavaScript
Raw Normal View History

2023-11-11 03:33:41 -05:00
import { Box, Icon, ProgressBar } from 'resource:///com/github/Aylur/ags/widget.js';
export default () => Box({
className: 'osd',
children: [
Icon({
hpack: 'start',
icon: 'keyboard-brightness-symbolic',
}),
ProgressBar({
vpack: 'center',
connections: [[Brightness, self => {
if (!self.value) {
self.value = Brightness.kbd / 2;
return;
}
self.value = Brightness.kbd / 2;
self.sensitive = Brightness.kbd !== 0;
const stack = self.get_parent().get_parent();
stack.shown = 'kbd';
stack.resetTimer();
}, 'kbd']],
}),
],
});