Awesome Go

go-notify

CategoryMessaging
SubcategoryMessaging
Stars0

Native implementation of the freedesktop notification spec

About go-notify

go-notify

PkgGoDev

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
}

Frequently Asked Questions

What is go-notify?

go-notify is a Messaging library for the Go programming language. Native implementation of the freedesktop notification spec

How do I install go-notify?

Install go-notify with the Go module system using `go get TheCreeper/go-notify`. Check the repository for the current installation instructions.

What category does go-notify belong to?

go-notify is listed under Messaging, specifically Messaging.

← Back to Messaging