diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-04-21 17:07:11 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-04-21 17:07:11 -0700 |
| commit | c551d98a53c393140c54e955b1d4fd7005f43b54 (patch) | |
| tree | ff255ee9a0567e27418fcf51f84c09d65ef5f575 /srv/server.go | |
| parent | 66b56a093bcd48030733a17382368c53f5b79455 (diff) | |
Add proper expiration and sort settings
Diffstat (limited to 'srv/server.go')
| -rw-r--r-- | srv/server.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/srv/server.go b/srv/server.go index 27ced3f..2500f62 100644 --- a/srv/server.go +++ b/srv/server.go @@ -11,8 +11,8 @@ import ( "github.com/godbus/dbus/v5" ) -const DEFAULT_EXPIRATION = 5000 -const SORT_DIRECTION = 1 // 1 = newest first, -1 = oldest first +var DEFAULT_EXPIRATION int +var SORT_DIRECTION int // 1 = newest first, -1 = oldest first type server struct { notifications *notificationStack @@ -80,12 +80,15 @@ func (s server) output() { fmt.Println(string(j)) } -func Start() { +func Start(defaultExpiration int, sortDirection int) { const NOTIF_DBUS_OBJECT = "/org/freedesktop/Notifications" const NOTIF_DBUS_NAME = "org.freedesktop.Notifications" const CORVID_DBUS_OBJECT = "/sh/cxl/Corvid" const CORVID_DBUS_NAME = "sh.cxl.Corvid" + DEFAULT_EXPIRATION = defaultExpiration + SORT_DIRECTION = sortDirection + notifications := notificationStack{ mutex: &sync.Mutex{}, notifications: make(map[uint32]notification), |