go notify
1.0.0
Package Notify fournit une implémentation de la spécification des notifications GNOME DBUS.
Affichez une notification simple.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
if _ , err := ntf . Show (); err != nil {
return
}Affichez une notification avec une icône. Consultez la spécification de dénomination de l'icône.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
ntf . AppIcon = "network-wireless"
if _ , err := ntf . Show (); err != nil {
return
}Affichez une notification qui n'expire jamais.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
ntf . Timeout = notify . ExpiresNever
if _ , err := ntf . Show (); err != nil {
return
}Jouez un son avec la 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
}