2023-10-31 08:32:40 -04:00
|
|
|
import { Box, Label } from 'resource:///com/github/Aylur/ags/widget.js';
|
|
|
|
import { subprocess, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
|
2023-09-04 22:27:34 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
import EventBox from '../misc/cursorbox.js';
|
2023-09-04 22:27:34 -04:00
|
|
|
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default () => EventBox({
|
2023-10-20 23:11:21 -04:00
|
|
|
halign: 'center',
|
2023-10-17 13:47:02 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
onPrimaryClickRelease: () => {
|
|
|
|
execAsync(['bash', '-c', '$AGS_PATH/heart.sh toggle']).catch(print);
|
|
|
|
},
|
2023-10-17 13:47:02 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
child: Box({
|
|
|
|
className: 'heart-toggle',
|
|
|
|
vertical: false,
|
2023-09-04 22:27:34 -04:00
|
|
|
|
2023-10-20 23:11:21 -04:00
|
|
|
child: Label({
|
|
|
|
label: '',
|
|
|
|
setup: self => {
|
|
|
|
subprocess(
|
|
|
|
['bash', '-c', 'tail -f /home/matt/.config/.heart'],
|
|
|
|
output => self.label = ' ' + output,
|
|
|
|
);
|
|
|
|
},
|
|
|
|
}),
|
2023-09-04 22:27:34 -04:00
|
|
|
}),
|
|
|
|
});
|