class Notify
- Notify
- Reference
- Object
Overview
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:
notify.crnotify/version.cr
Constant Summary
-
VERSION =
"0.1.0"
Constructors
Instance Method Summary
-
#capabilities : Array(String)
An array of strings indicating the capabilities of this notification daemon.
-
#capability?(feature : String)
Checks whether the user's notification daemon supports feature.
-
#close(id : UInt32)
Closes the open notification whose identifier is id, or does nothing if that notification is already closed.
-
#information : Array(String)
An array of strings indicating the version and vendor of this notification daemon.
-
#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.
Constructor Detail
Instance Method Detail
An array of strings indicating the capabilities of this notification daemon.
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
Closes the open notification whose identifier is id, or does nothing if that notification is already closed.
n.close(1337)
An array of strings indicating the version and vendor of this notification daemon.
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