diff --git a/src/hyprman.nim b/src/hyprman.nim index d2c269f..db6ee89 100644 --- a/src/hyprman.nim +++ b/src/hyprman.nim @@ -68,6 +68,7 @@ proc getActive(m: Monitor): int {.inline.} = m.activeWorkspace.id proc getState(): seq[seq[WorkspaceIcon]] = let monitors = parseJson(getData("[-j]/monitors")).to(seq[Monitor]) + defaultWorkspaces = getDefaultWorkspaces() for m in monitors: result.add defaultWorkspaces @@ -100,7 +101,15 @@ proc reactEvent(line: string) = discard execCmd "eww reload" else: discard +proc initEww() = + let monitors = parseJson(getData("[-j]/monitors")).to(seq[Monitor]) + discard execCmd "eww daemon" + discard execCmd "eww open bar0" + if monitors.len > 1: + discard execCmd "eww open bar1" + proc watchHyprlandEvents() {.async.} = + initEww() let socketPath = "/tmp/hypr" / his / ".socket2.sock" socket = newAsyncSocket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)