go notify
1.0.0
Paketbenachrichtigung bietet eine Implementierung der Spezifikation der GNOME DBUS -Benachrichtigungen.
Zeigen Sie eine einfache Benachrichtigung an.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
if _ , err := ntf . Show (); err != nil {
return
}Zeigen Sie eine Benachrichtigung mit einem Symbol an. Wenden Sie sich an die Spezifikation für die Namensnamens.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
ntf . AppIcon = "network-wireless"
if _ , err := ntf . Show (); err != nil {
return
}Zeigen Sie eine Benachrichtigung an, die niemals abläuft.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
ntf . Timeout = notify . ExpiresNever
if _ , err := ntf . Show (); err != nil {
return
}Spielen Sie einen Ton mit der Benachrichtigung.
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
}