package obus
A pure OCaml implementation of DBus
Install
Dune Dependency
Authors
Maintainers
Sources
1.1.8.tar.gz
sha256=84aa0003157b0299e43b20a4127b7af04a0fd99878d7ce540bbbfbc6157dfe4f
md5=976947861f1dfa3d3da68378f25377c1
doc/obus.notification/Notification/index.html
Module Notification
Popup notifications
For complete details about notifications, look at the the official specifications
val app_name : string ref
Application name used for notification. The default value is taken from Sys.argv.(0)
val desktop_entry : string option ref
If the application has a desktop entry, it can be specified here
Operations on notifications
val result : 'a t -> 'a Lwt.t
Waits for a notification to be closed then returns:
`Closed
if the user clicked on the cross, timeout was reached or the notification daemon exited
`Default
if the default action was invoked, i.e. the user clicked on the notification, but not on a buttons
- the corresponding action if the user clicked on a button other than the cross
val close : 'a t -> unit Lwt.t
Close the notification now
Opening notifications
type image = {
img_width : int;
img_height : int;
img_rowstride : int;
img_has_alpha : bool;
img_bits_per_sample : int;
img_channels : int;
img_data : string;
}
An image description
val notify :
?app_name:string ->
?desktop_entry:string ->
?replace:_ t ->
?icon:string ->
?image:image ->
summary:string ->
?body:string ->
?actions:(string * ([> `Default | `Closed ] as 'a)) list ->
?urgency:urgency ->
?category:string ->
?sound_file:string ->
?suppress_sound:bool ->
?pos:(int * int) ->
?hints:(string * OBus_value.V.single) list ->
?timeout:int ->
unit ->
'a t Lwt.t
Open a notification.
app_name
anddesktop_entry
can override default values taken from referencesreplace
is a popup id this notification replaceicon
is the notification icon. It is either as a URI (file://...) or a name in a freedesktop.org-compliant icon theme (not a GTK+ stock ID)image
is an image, it is used ificon
is not presentsummary
is a single line overview of the notificationbody
is a multi-line body of text. Each line is a paragraph, server implementations are free to word wrap them as they see fit. The body may contain simple markup as specified in Markup. It must be encoded using UTF-8. If the body is omitted, just the summary is displayed.action
is a list of (text, key) pair,text
is the text displayed to the user andkey
is the value which will be returned when the action is invokedcategory
is a string representing the category of the notification, for example: "device.added", "email.arrived" (more category can be found in the specifications)sound_file
is a sound file to play while displaying the notificationsuppress_sound
tell the daemon to suppress soundspos
is a screen positionhints
is a list of additionnal hintstimeout
is a timeout in millisecond
Informations
val get_server_information : unit -> server_info Lwt.t
Retreive server informations
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page