golibnotify
implements go bindings for
libnotify
to create, send,
and update OS level notifications. It does not shell out to notify-send
so it
can update existing notifications as well as create new ones.
This package requires CGO and the libnotify (libnotify-dev
) shared library to be installed.
On Ubuntu or Debian using apt
, you can install with sudo apt-get install libnotify-dev
// Get an instance of a SimpleNotifier
notifier := golibnotify.NewSimpleNotifier("my-cool-app-name")
// Show a new notification
err = notifier.Show("A summary", "Some body text", "a/path/to/an/icon.png")
// Update an existing notification (or send a new one if one hasn't been sent)
err = notifier.Update("A new summary", "Some different body text", "another/path/to/icon.png")
// Remove an existing notification
err = notifier.Close()
See also examples for a complete example
Thanks for wanting to contribute!
master
here.