1 // This file is a part of git.thekondor.net/zvuchno.git (mirror: github.com/thekondor/zvuchno)
6 "github.com/godbus/dbus"
9 type VolumeNotification struct {
11 notificationReplacementID uint32
14 func NewVolumeNotification(bus *dbus.Conn) VolumeNotification {
15 obj := bus.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
16 return VolumeNotification{conn: obj}
19 func (vn *VolumeNotification) Show(title, message string, timeout uint32) {
20 hints := map[string]interface{}{}
22 "org.freedesktop.Notifications.Notify", 0, "Volume",
23 vn.notificationReplacementID, "volume", title, message, []string{}, hints, int(timeout))
24 out.Store(&vn.notificationReplacementID)