liminix/pkgs/anoia/nl.fnl

16 lines
357 B
Text
Raw Permalink Normal View History

(local netlink (require :netlink))
2024-03-11 23:16:49 +01:00
; (local { : view } (require :fennel))
(fn events [groups]
(let [sock (netlink.socket)]
(coroutine.wrap
(fn []
(each [_ e (ipairs (sock:query groups))]
(coroutine.yield e))
(while (sock:poll)
(each [_ e (ipairs (sock:event))]
(coroutine.yield e)))))))
{ : events }