Documentation ¶
Overview ¶
Package freedesktop implements the Desktop Notifications Specification version 1.2.
See https://developer.gnome.org/notification-spec/ for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNotifier ¶
NewNotifier returns a new Notifier.
Register supports following icon types:
- string
- image.Image
Register accepts following keys and value types:
- freedesktop:actions map[string]string
- freedesktop:hints map[string]interface{}
- freedesktop:timeout int32
Types ¶
type ActionInvoked ¶
ActionInvoked represents an ActionInvoked signal.
type Client ¶
type Client struct { NotificationClosed chan NotificationClosed ActionInvoked chan ActionInvoked // contains filtered or unexported fields }
Client is a notification client.
func (*Client) CloseNotification ¶
CloseNotification closes and removes the notification of the specified id.
func (*Client) GetCapabilities ¶
GetCapabilities retrieves capabilities that the server implements.
See https://developer.gnome.org/notification-spec/#command-get-capabilities for available capabilities.
func (*Client) GetServerInformation ¶
func (c *Client) GetServerInformation() (si ServerInfo, err error)
GetServerInformation retrieves the information of the server.
type ImageData ¶
type ImageData struct { Width int32 Height int32 Stride int32 Alpha bool BitsPerSample int32 NumChannels int32 Data []byte }
ImageData represents a raw image data structure of signature (iiibiiay).
See https://developer.gnome.org/notification-spec/#icons-and-images for details.
type Notification ¶
type Notification struct { Name string // Application Name ID uint32 // Replaces ID Icon string // Notification Icon Summary string // Summary Body string // Body Actions []string // Actions Hints map[string]interface{} // Hints Timeout int32 // Expiration Timeout }
Notification represents a notification.
See https://developer.gnome.org/notification-spec/#basic-design for details.
func (*Notification) Action ¶
func (n *Notification) Action(key, label string)
Action adds (or replaces) the specified action to the Notification.
func (*Notification) Hint ¶
func (n *Notification) Hint(name string, value interface{}) error
Hint adds (or replaces) the specified hint to the Notification.
See https://developer.gnome.org/notification-spec/#hints for available hints.
type NotificationClosed ¶
NotificationClosed represents a NotificationClosed signal.