wip on dbus notifications

dbus-notify
Zlatin Balevsky 2022-08-25 22:05:55 +01:00
parent 65304c5175
commit 4a322074a0
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,8 @@ import org.freedesktop.Notifications
import org.freedesktop.dbus.connections.impl.DBusConnection
import org.freedesktop.dbus.connections.impl.DBusConnectionBuilder
import org.freedesktop.dbus.interfaces.DBusInterface
import org.freedesktop.dbus.types.UInt32
import org.freedesktop.dbus.types.UInt64
class NotifyService {
@ -16,6 +18,20 @@ class NotifyService {
}
static void notify(String text) {
println "notifying $text"
Notifications notifications = CONNECTION.getRemoteObject(BUS_NAME, BUS_PATH, Notifications.class)
println "capabilities"
println notifications.GetCapabilities()
UInt32 rv = notifications.Notify("MuWire", // app name
new UInt32(0L)), // replaces
"", // no icon
text, // summary
text, // body
Collections.emptyList(), // actions
Collections.emptyMap(), // hints
-1) // expire timeout
println "rv is $rv"
}
}