From 2aa3e0db32e96eb82ef06450ae3b82f0d564589a Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Sun, 1 May 2022 22:49:55 +0100 Subject: [PATCH] set ENTER on pingclock to refresh pingclock --- pingclock.nim | 4 +++- volume.nim | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pingclock.nim b/pingclock.nim index 41c755b..fa3d103 100644 --- a/pingclock.nim +++ b/pingclock.nim @@ -57,7 +57,9 @@ proc main() = let ping = get_ping() if ping != last_ping: let data = getObject(ping) - outputJSON(data) + let output = outputJSON(data) + if output == data.full_text: + main() last_ping = ping loop = not stoploop if loop: diff --git a/volume.nim b/volume.nim index b33b1a8..e259e77 100644 --- a/volume.nim +++ b/volume.nim @@ -77,20 +77,18 @@ proc get_volume*(run_once: bool = false) = else: try: let vol = parseInt(option) - discard execCmd("pamixer --set-volume " & $vol) + let x = execCmd("pamixer --set-volume " & $vol) + echo x get_volume() except: echo getCurrentExceptionMsg() - - - - + get_volume() if run_once: break last_vol = vol - sleep(1000) if stoploop: break + sleep(1000) proc main() = get_volume()