libnotify:   an FFI binding for libnotify
notification%
new
show
close
exn:  fail:  libnotify
8.12

libnotify: an FFI binding for libnotify🔗ℹ

 (require libnotify) package: libnotify

This library provides an FFI binding to the libnotify library which provides support for the desktop notifications API.

class

notification% : class?

  superclass: object%

constructor

(new notification% 
    [summary summary] 
    [[body body] 
    [icon icon] 
    [timeout timeout] 
    [urgency urgency] 
    [category category]]) 
  (is-a?/c notification%)
  summary : string?
  body : (or/c string? #f) = #f
  icon : (or/c (is-a?/c bitmap%) path-string? #f) = #f
  timeout : (or/c (>=/c 0) #f) = #f
  urgency : (or/c 'low 'normal 'critical) = 'normal
  category : (or/c string? #f) = #f
Constructs a new notification object.

The summary, body, and icon describe the content of the notification when displayed. If icon describes a file system path, an icon will be loaded from that path. If it is a bitmap% object, it will be rendered directly.

The timeout argument specifies a timeout in seconds. Note that if the Racket process exits before the timeout triggers, it will have no effect and the timeout will be ignored.

See the Desktop Notification specification for details on the meaning and recommended use of the urgency and category arguments.

method

(send a-notification show)  void?

Displays the notification on the screen.

If the display fails, then an instance of exn:fail:libnotify is raised.

method

(send a-notification close)  void?

Closes the notification and removes it from the screen.

If the close operation fails, then an instance of exn:fail:libnotify is raised.

struct

(struct exn:fail:libnotify exn:fail ()
    #:extra-constructor-name make-exn:fail:libnotify)
An exception structure type for reporting errors from the underlying libnotify library.