Documentation
¶
Overview ¶
Package desktopnotify sends freedesktop notifications over the session bus, the Go counterpart of crates/wayle-shell-core's notify.rs: D-Bus directly rather than notify-send, whose absence from PATH would silently drop every notification.
Index ¶
- func Notify(appName, summary, body, appIcon string)
- type Action
- type Sender
- func (s *Sender) Ask(ctx context.Context, appName, summary, body, appIcon string, actions []Action, ...) (key string, ok bool, err error)
- func (s *Sender) Send(ctx context.Context, appName, summary, body, appIcon string) (uint32, error)
- func (s *Sender) SendCritical(ctx context.Context, appName, summary, body, appIcon string) (uint32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
Action is one notification button: Key is what Ask reports, Label what the daemon shows.
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender delivers notifications on one bus connection.
func (*Sender) Ask ¶
func (s *Sender) Ask(ctx context.Context, appName, summary, body, appIcon string, actions []Action, timeout time.Duration) (key string, ok bool, err error)
Ask posts a notification with buttons and waits for the user (notify.rs's notify_with_actions + NotifyReceipt::action): the key of the button pressed, or ok=false when the notification closed or expired without one, or ctx ended first. timeout is the daemon's expire timeout. The icon also goes in the image-path hint, as libnotify does, which lys-shell's own popup reads.