aboutsummaryrefslogtreecommitdiff
path: root/srv/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'srv/server.go')
-rw-r--r--srv/server.go9
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),