diff options
Diffstat (limited to 'srv')
| -rw-r--r-- | srv/notifServer.go | 2 | ||||
| -rw-r--r-- | srv/server.go | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/srv/notifServer.go b/srv/notifServer.go index d175055..a64a165 100644 --- a/srv/notifServer.go +++ b/srv/notifServer.go @@ -100,7 +100,7 @@ func (s notifServer) Notify(appName string, replacesId uint32, appIcon string, s } if expireTimeout == -1 { - expireTimeout = DEFAULT_EXPIRATION + expireTimeout = int32(DEFAULT_EXPIRATION) } notification := notification{ 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), |