Categorygithub.com/TheCreeper/go-notify
modulepackage
0.2.0
Repository: https://github.com/thecreeper/go-notify.git
Documentation: pkg.go.dev

# README

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
}

# Functions

CloseNotification closes the notification if it exists using its id.
GetCapabilities returns the capabilities of the notification server.
GetServerInformation returns information about the notification server such as its name and version.
NewNotification creates a new notification object with some basic information.

# Constants

Notification object paths and interfaces.
Notification object paths and interfaces.
Notification object paths and interfaces.
Notification object paths and interfaces.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification Categories.
Notification object paths and interfaces.
Notification object paths and interfaces.
Notification object paths and interfaces.
Notification object paths and interfaces.
Notification expire timeout.
Notification expire timeout.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Hints.
Notification object paths and interfaces.
Notification object paths and interfaces.
Urgency Levels.
Urgency Levels.
Urgency Levels.

# Structs

Capabilities is a struct containing the capabilities of the notification server.
Notification is a struct which describes the notification to be displayed by the notification server.
ServerInformation is a struct containing information about the server such as its name and version.