From 7c46d2e8fda868c607dc3dc5a24daf87902b49f5 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 23 Jan 2024 16:16:29 -0600 Subject: [PATCH] poor man error fix --- home/private_dot_config/eww/bin/hyprstate.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/home/private_dot_config/eww/bin/hyprstate.nim b/home/private_dot_config/eww/bin/hyprstate.nim index a31250c..7947d6d 100644 --- a/home/private_dot_config/eww/bin/hyprstate.nim +++ b/home/private_dot_config/eww/bin/hyprstate.nim @@ -56,6 +56,7 @@ proc getData(data: string): string = socket.close() # is this necessary? return response + proc getDefaultWorkspaces(): seq[WorkspaceIcon] = let clients = parseJson(getData("[-j]/clients")).to(seq[Client]) result = collect(for i in 1..9: WorkspaceIcon(id: i, icon:"",class:fmt"ws-button-{i - 1}")) @@ -81,4 +82,7 @@ proc getState(): seq[seq[WorkspaceIcon]] = when isMainModule: while true: sleep 500 - echo (%* getState()) + try: + echo (%* getState()) + except JsonParsingError: + discard