2022-06-10 04:49:49 +00:00
|
|
|
# SPDX-FileCopyrightText: ☭ 2022 Emery Hemingway
|
|
|
|
# SPDX-License-Identifier: Unlicense
|
|
|
|
|
|
|
|
import std/[asyncdispatch, strutils]
|
|
|
|
import syndicate
|
|
|
|
import ./private/libnotify
|
2022-06-10 17:08:35 +00:00
|
|
|
import ./schema/notifications
|
2022-06-10 04:49:49 +00:00
|
|
|
|
|
|
|
bootDataspace("main") do (ds: Ref; turn: var Turn):
|
|
|
|
connectStdio(ds, turn)
|
|
|
|
let nc = newNotifyClient("syndicate")
|
|
|
|
onMessage(turn, ds, ?Notify) do (s: string, b: string, t: int, u: Urgency):
|
|
|
|
nc.send_new_notification(
|
|
|
|
summary = s,
|
|
|
|
body = b,
|
|
|
|
icon_fname = "",
|
|
|
|
timeout = t,
|
|
|
|
urgency = NotificationUrgency u)
|
|
|
|
|
|
|
|
runForever()
|