go notify
1.0.0
O pacote Notify fornece uma implementação da especificação de notificações do GNOME DBUS.
Exibir uma notificação simples.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
if _ , err := ntf . Show (); err != nil {
return
}Exiba uma notificação com um ícone. Consulte a especificação de nomeação do ícone.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
ntf . AppIcon = "network-wireless"
if _ , err := ntf . Show (); err != nil {
return
}Exibir uma notificação que nunca expira.
ntf := notify . NewNotification ( "Test Notification" , "Just a test" )
ntf . Timeout = notify . ExpiresNever
if _ , err := ntf . Show (); err != nil {
return
}Jogue um som com a notificação.
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
}