feat: add eww initialization
This commit is contained in:
parent
a4d9252d6a
commit
64641a3402
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue