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

27 lines
658 B
JavaScript

import { Box, Icon, ProgressBar } from 'resource:///com/github/Aylur/ags/widget.js';
import Brightness from '../../services/brightness.js';
export default () => Box({
className: 'osd',
children: [
Icon({
hpack: 'start',
icon: 'display-brightness-symbolic',
}),
ProgressBar({
vpack: 'center',
connections: [[Brightness, (self) => {
self.value = Brightness.screen;
const stack = self.get_parent().get_parent();
stack.shown = 'brightness';
stack.resetTimer();
}, 'screen']],
}),
],
});