class

Notify

Inherits Reference / Object

Notify is a Crystal library for Desktop Notifications compatible notification systems. It uses DBus internally to connect to the user's notification daemon.

Constants

VERSION = "0.1.0"

Constructors

new

Creates a new instance of Notify.

Source

Instance methods

capabilities

An array of strings indicating the capabilities of this notification daemon.

Source
capability?(feature : String)

Checks whether the user's notification daemon supports feature.

The list of currently standardized features can be found here: http://www.galago-project.org/specs/notification/0.9/x408.html#command-get-capabilities

n.capability?("body") # => true
Source
close(id : UInt32)

Closes the open notification whose identifier is id, or does nothing if that notification is already closed.

n.close(1337)
Source
information

An array of strings indicating the version and vendor of this notification daemon.

Source
notify(summary, app_name = "", replaces_id = 0_u32, app_icon = "", body = "", actions = [] of String, hints = {} of String => DBus::Variant, expire_timeout = -1)

Creates a new notification. summary is the only required parameter.

See http://www.galago-project.org/specs/notification/0.9/x408.html#command-notify for information on optional parameters.

Returns a notification ID that can be used with close or as replaces_id in subsequent calls to notify.

n.notify "hello", body: "<b>world!</b>" # => 1337
Source