From 23e50efee015bc958fe4ac500306d711c444c73c Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 4 Sep 2023 22:47:12 -0400 Subject: [PATCH] style(ags osk): clarify code a bit --- config/ags/js/bar/osk-toggle.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/config/ags/js/bar/osk-toggle.js b/config/ags/js/bar/osk-toggle.js index 2004a4c2..3b9b8ad9 100644 --- a/config/ags/js/bar/osk-toggle.js +++ b/config/ags/js/bar/osk-toggle.js @@ -1,7 +1,11 @@ -import { Separator, EventBox } from '../common.js'; +const { Box, Label } = ags.Widget; +const { subprocess, exec } = ags.Utils; +const deflisten = subprocess; -ags.Utils.subprocess( - ['bash', '-c', '/home/matt/.nix/config/ags/scripts/osk-toggle.sh getState'], +import { EventBox } from '../common.js'; + +deflisten( + ['bash', '-c', '/home/matt/.nix/config/ags/bin/osk-toggle.sh getState'], (output) => { if (output == 'Running') { OskToggle.toggleClassName('toggle-on', true); @@ -13,7 +17,7 @@ ags.Utils.subprocess( export const OskToggle = EventBox({ className: 'toggle-off', onPrimaryClickRelease: function() { - ags.Utils.subprocess( + subprocess( ['bash', '-c', '/home/matt/.nix/config/ags/bin/osk-toggle.sh toggle'], (output) => { if (output == 'Running') { @@ -24,12 +28,12 @@ export const OskToggle = EventBox({ }, ); }, - child: ags.Widget.Box({ + child: Box({ className: 'osk-toggle', vertical: false, children: [ - ags.Widget.Label({ + Label({ label: " 󰌌 ", }), ],