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

28 lines
600 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
2023-09-11 19:57:21 -04:00
import { EventBox } from '../misc/cursorbox.js';
2023-09-04 22:27:34 -04:00
subprocess(
2023-09-04 22:27:34 -04:00
['bash', '-c', 'tail -f /home/matt/.config/.heart'],
(output) => {
Heart.child.children[0].label = ' ' + output;
},
);
export const Heart = EventBox({
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: '',
}),
}),
});