Skip to content
Package notify provides an implementation of the Gnome DBus Notifications Specification.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Add NL to LICENSE. Feb 2, 2016
README.md Whoops. Feb 3, 2016
notify.go Update pkg desc. Feb 3, 2016
notify_test.go Merge pull request #2 from MajorMJR/master Dec 29, 2015

README.md

go-notify

GoDoc

Package notify provides an implementation of the Gnome DBus Notifications Specification.

Examples

Display a simple notification.

ntf := notify.NewNotification("Test Notification", "Just a test")
if _, err := ntf.Show(); err != nil {
	return
}

Display a notification with an icon. Consult the Icon Naming Specification.

ntf := notify.NewNotification("Test Notification", "Just a test")
ntf.AppIcon = "network-wireless"
if _, err := ntf.Show(); err != nil {
	return
}

Display a notification that never expires.

ntf := notify.NewNotification("Test Notification", "Just a test")
ntf.Timeout = notify.ExpiresNever
if _, err := ntf.Show(); err != nil {
	return
}

Play a sound with the notification.

ntf := notify.NewNotification("Test Notification", "Just a test")
ntf.Hints = make(map[string]interface{})
ntf.Hints[notify.HintSoundFile] = "/home/my-username/sound.oga"
if _, err := ntf.Show(); err != nil {
	return
}
You can’t perform that action at this time.