set ENTER on pingclock to refresh pingclock

This commit is contained in:
Paul Wilde 2022-05-01 22:49:55 +01:00
parent d59ea16991
commit 2aa3e0db32
2 changed files with 7 additions and 7 deletions

View file

@ -57,7 +57,9 @@ proc main() =
let ping = get_ping() let ping = get_ping()
if ping != last_ping: if ping != last_ping:
let data = getObject(ping) let data = getObject(ping)
outputJSON(data) let output = outputJSON(data)
if output == data.full_text:
main()
last_ping = ping last_ping = ping
loop = not stoploop loop = not stoploop
if loop: if loop:

View file

@ -77,20 +77,18 @@ proc get_volume*(run_once: bool = false) =
else: else:
try: try:
let vol = parseInt(option) let vol = parseInt(option)
discard execCmd("pamixer --set-volume " & $vol) let x = execCmd("pamixer --set-volume " & $vol)
echo x
get_volume() get_volume()
except: except:
echo getCurrentExceptionMsg() echo getCurrentExceptionMsg()
get_volume()
if run_once: if run_once:
break break
last_vol = vol last_vol = vol
sleep(1000)
if stoploop: if stoploop:
break break
sleep(1000)
proc main() = proc main() =
get_volume() get_volume()