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]] =
|
proc getState(): seq[seq[WorkspaceIcon]] =
|
||||||
let
|
let
|
||||||
monitors = parseJson(getData("[-j]/monitors")).to(seq[Monitor])
|
monitors = parseJson(getData("[-j]/monitors")).to(seq[Monitor])
|
||||||
|
|
||||||
defaultWorkspaces = getDefaultWorkspaces()
|
defaultWorkspaces = getDefaultWorkspaces()
|
||||||
for m in monitors:
|
for m in monitors:
|
||||||
result.add defaultWorkspaces
|
result.add defaultWorkspaces
|
||||||
|
@ -100,7 +101,15 @@ proc reactEvent(line: string) =
|
||||||
discard execCmd "eww reload"
|
discard execCmd "eww reload"
|
||||||
else: discard
|
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.} =
|
proc watchHyprlandEvents() {.async.} =
|
||||||
|
initEww()
|
||||||
let
|
let
|
||||||
socketPath = "/tmp/hypr" / his / ".socket2.sock"
|
socketPath = "/tmp/hypr" / his / ".socket2.sock"
|
||||||
socket = newAsyncSocket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)
|
socket = newAsyncSocket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)
|
||||||
|
|
Loading…
Reference in a new issue