style(ags heart): clarify code a bit

This commit is contained in:
matt1432 2023-09-04 22:44:00 -04:00
parent a47507b171
commit 8bb4bcbc2f

View file

@ -1,8 +1,10 @@
const { Box, Label } = ags.Widget;
const { subprocess, exec } = ags.Utils;
const deflisten = subprocess;
import { EventBox } from '../common.js'; import { EventBox } from '../common.js';
ags.Utils.subprocess( deflisten(
['bash', '-c', 'tail -f /home/matt/.config/.heart'], ['bash', '-c', 'tail -f /home/matt/.config/.heart'],
(output) => { (output) => {
Heart.child.children[0].label = ' ' + output; Heart.child.children[0].label = ' ' + output;
@ -17,14 +19,14 @@ ags.Utils.subprocess(
export const Heart = EventBox({ export const Heart = EventBox({
className: 'toggle-off', className: 'toggle-off',
halign: 'center', halign: 'center',
onPrimaryClickRelease: function() { onPrimaryClickRelease: () => {
ags.Utils.exec('/home/matt/.nix/config/ags/bin/heart.sh toggle'); exec('/home/matt/.nix/config/ags/bin/heart.sh toggle');
}, },
child: ags.Widget.Box({ child: Box({
className: 'heart-toggle', className: 'heart-toggle',
vertical: false, vertical: false,
child: ags.Widget.Label({ child: Label({
label: '', label: '',
}), }),
}), }),