class Notify


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

Defined in:


Constant Summary

VERSION = "0.1.0"


Instance Method Summary

Constructor Detail

def #

Creates a new instance of Notify.

[View source]

Instance Method Detail

def capabilities : Array(String) #

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

[View source]
def capability?(feature : String) #

Checks whether the user's notification daemon supports feature.

The list of currently standardized features can be found here: <>

n.capability?("body") # => true

[View source]
def close(id : UInt32) #

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


[View source]
def information : Array(String) #

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

[View source]
def 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 <> 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

[View source]