stumpwm.stumpwm-contrib/util/notify/README.org

48 lines
1.3 KiB
Org Mode

Notifications server for StumpWM.
Implements =org.freedesktop.Notifications= interface[fn:dbus-spec].
Shows notifications using =stumpwm:message= by default.
** Usage
Add
#+begin_src lisp
(load-module "notify")
(notify:notify-server-toggle)
#+end_src
to =.stumpwmrc=
Now you can run default server using =notify-server-toggle=.
In order to get your own notifications handler you can define on function
#+begin_src lisp
(defun notification-handler (app icon summary body)
"Does things with incoming notifications"
...)
#+end_src
** Dependencies
On Debian/Ubuntu[fn:1] there's a dependency on =libfixposix-dev=. If you get an error
such as the following:
#+BEGIN_QUOTE
~/quicklisp/dists/quicklisp/software/iolib-v0.8.3/src/syscalls/ffi-types-unix.c:14:10: fatal error: lfp.h: No such file or directory
#+END_QUOTE
Then you need to install the dev package:
#+BEGIN_SRC sh
apt-get install -y libfixposix-dev
#+END_SRC
** Testing
You can test notifications (if you have notify-send installed) with:
#+BEGIN_SRC sh
notify-send 'Hello world!' 'This is an example notification.'
#+END_SRC
* Footnotes
[fn:1] ...and possibly other distributions too
[fn:dbus-spec] [[https://specifications.freedesktop.org/notification-spec/latest/ar01s09.html][D-BUS Notifications Protocol Spec]]