From 64641a34026be172309f193ca5376833098c665a Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 8 Feb 2024 12:56:52 -0600 Subject: [PATCH] feat: add eww initialization --- src/hyprman.nim | 9 +++++++++ 1 file changed, 9 insertions(+) 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)