Documentation ¶
Overview ¶
Package notifications wraps a couple of Notifications's DBus API points: the org.freedesktop.Notifications.Notify call, and listening for the ActionInvoked signal.
Index ¶
- Variables
- type RawAction
- type RawNotifications
- func (raw *RawNotifications) Notify(app_name string, reuse_id uint32, icon, summary, body string, actions []string, ...) (uint32, error)
- func (raw *RawNotifications) Present(app *click.AppId, nid string, notification *launch_helper.Notification) bool
- func (raw *RawNotifications) WatchActions() (<-chan *RawAction, error)
Constants ¶
This section is empty.
Variables ¶
var BusAddress bus.Address = bus.Address{
Interface: "org.freedesktop.Notifications",
Path: "/org/freedesktop/Notifications",
Name: "org.freedesktop.Notifications",
}
Notifications lives on a well-knwon bus.Address
Functions ¶
This section is empty.
Types ¶
type RawAction ¶
type RawAction struct { App *click.AppId `json:"app,omitempty"` Action string `json:"act,omitempty"` ActionId int `json:"aid,omitempty"` Nid string `json:"nid,omitempty"` RawId uint32 `json:"-"` }
convenience type for the (uint32, string) ActionInvoked signal data
type RawNotifications ¶
type RawNotifications struct {
// contains filtered or unexported fields
}
a raw notification provides a low-level interface to the f.d.o. dbus notifications api
func (*RawNotifications) Notify ¶
func (raw *RawNotifications) Notify( app_name string, reuse_id uint32, icon, summary, body string, actions []string, hints map[string]*dbus.Variant, timeout int32) (uint32, error)
Notify fires a notification
func (*RawNotifications) Present ¶
func (raw *RawNotifications) Present(app *click.AppId, nid string, notification *launch_helper.Notification) bool
Present displays a given card.
If card.Actions is empty it's a plain, noninteractive bubble notification. If card.Actions has 1 action, it's an interactive notification. If card.Actions has 2 actions, it will show as a snap decision. If it has more actions, who knows (good luck).
func (*RawNotifications) WatchActions ¶
func (raw *RawNotifications) WatchActions() (<-chan *RawAction, error)
WatchActions listens for ActionInvoked signals from the notification daemon and sends them over the channel provided