From 8bb4bcbc2f11f51321745e35a2ca36700cb8e78a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 4 Sep 2023 22:44:00 -0400 Subject: [PATCH] style(ags heart): clarify code a bit --- config/ags/js/bar/heart.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/ags/js/bar/heart.js b/config/ags/js/bar/heart.js index 9b895a53..8a6d50e0 100644 --- a/config/ags/js/bar/heart.js +++ b/config/ags/js/bar/heart.js @@ -1,8 +1,10 @@ - +const { Box, Label } = ags.Widget; +const { subprocess, exec } = ags.Utils; +const deflisten = subprocess; import { EventBox } from '../common.js'; -ags.Utils.subprocess( +deflisten( ['bash', '-c', 'tail -f /home/matt/.config/.heart'], (output) => { Heart.child.children[0].label = ' ' + output; @@ -17,14 +19,14 @@ ags.Utils.subprocess( export const Heart = EventBox({ className: 'toggle-off', halign: 'center', - onPrimaryClickRelease: function() { - ags.Utils.exec('/home/matt/.nix/config/ags/bin/heart.sh toggle'); + onPrimaryClickRelease: () => { + exec('/home/matt/.nix/config/ags/bin/heart.sh toggle'); }, - child: ags.Widget.Box({ + child: Box({ className: 'heart-toggle', vertical: false, - child: ags.Widget.Label({ + child: Label({ label: '', }), }),