2023-10-02 12:06:35 -04:00
|
|
|
import { Utils, Widget } from '../../imports.js';
|
|
|
|
const { ProgressBar, Overlay, Box } = Widget;
|
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
import Separator from '../misc/separator.js';
|
|
|
|
import Heart from './heart.js';
|
2023-09-08 15:15:04 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default () => Overlay({
|
2023-10-20 23:11:21 -04:00
|
|
|
tooltipText: 'Brightness',
|
|
|
|
child: ProgressBar({
|
|
|
|
className: 'toggle-off brightness',
|
|
|
|
connections: [
|
|
|
|
[200, self => {
|
|
|
|
Utils.execAsync('brightnessctl get').then(out => {
|
|
|
|
const br = out / 255;
|
|
|
|
if (br > 0.33)
|
|
|
|
self.value = br;
|
|
|
|
else
|
|
|
|
self.value = 0.33;
|
|
|
|
}).catch(print);
|
|
|
|
}],
|
|
|
|
],
|
2023-09-10 00:39:43 -04:00
|
|
|
}),
|
2023-10-20 23:11:21 -04:00
|
|
|
overlays: [
|
|
|
|
Box({
|
|
|
|
style: 'color: #CBA6F7;',
|
|
|
|
children: [
|
|
|
|
Separator(25),
|
|
|
|
Heart(),
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
],
|
2023-09-08 15:15:04 -04:00
|
|
|
});
|