nixos-configs/hosts/wim/config/ags/js/bar/heart.js

30 lines
632 B
JavaScript
Raw Normal View History

import { Utils, Widget } from '../../imports.js';
const { Box, Label } = Widget;
const { subprocess, execAsync } = Utils;
2023-09-04 22:27:34 -04:00
import EventBox from '../misc/cursorbox.js';
2023-09-04 22:27:34 -04:00
export default () => EventBox({
2023-09-04 22:27:34 -04:00
halign: 'center',
2023-09-04 22:44:00 -04:00
onPrimaryClickRelease: () => {
2023-09-26 13:33:30 -04:00
execAsync(['bash', '-c', '$AGS_PATH/heart.sh toggle']).catch(print);
2023-09-04 22:27:34 -04:00
},
2023-09-04 22:44:00 -04:00
child: Box({
2023-09-04 22:27:34 -04:00
className: 'heart-toggle',
vertical: false,
2023-09-04 22:44:00 -04:00
child: Label({
2023-09-04 22:27:34 -04:00
label: '',
setup: self => {
subprocess(
['bash', '-c', 'tail -f /home/matt/.config/.heart'],
(output) => self.label = ' ' + output,
);
},
2023-09-04 22:27:34 -04:00
}),
}),
});