X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3-doc.git;a=blobdiff_plain;f=statusd.tex;fp=statusd.tex;h=82e70ebab75f9ae9b1f78b643d2acf0979b7782c;hp=e1fe6b2f5a4f02605701a061b93e7507000e27b5;hb=da1e04def26932e7f91a2106c885142e7fafe59b;hpb=a35ba2541b8601953ae94f779a85ae70de19cd11 diff --git a/statusd.tex b/statusd.tex index e1fe6b2..82e70eb 100644 --- a/statusd.tex +++ b/statusd.tex @@ -1,14 +1,15 @@ \section{Writing \command{ion-statusd} monitors} +\label{sec:statusd} All statusbar meters that do not monitor the internal state of Ion should go in the separate \command{ion-statusd} program. -Whenever the user requests a meter \code{\%foo} or \code{\%foo_bar} to be -inserted in a statusbar, \file{mod\_statusbar} asks \command{ion-statusd} to -load \fnref{statusd_foo.lua} on its search path (same as that for Ion-side +Whenever the user requests a meter \codestr{\%foo} or \codestr{\%foo\_bar} to +be inserted in a statusbar, \file{mod\_statusbar} asks \command{ion-statusd} +to load \fnref{statusd_foo.lua} on its search path (same as that for Ion-side scripts). This script should then supply all meters with the initial part -'\code{foo}'. +\codestr{foo}. To provide this value, the script should simply call \code{statusd.inform} with the name of the meter and the value as a string. @@ -16,11 +17,11 @@ Additionally the script should provide a 'template' for the meter to facilitate expected width calculation by \file{mod\_statusbar}, and may provide a 'hint' for colour-coding the value. The interpretation of hints depends on the graphical style in use, and currently the -stock styles support the \code{normal}, \code{important} and -\code{critical} hints. +stock styles support the \codestr{normal}, \codestr{important} and +\codestr{critical} hints. -In our example of the 'foo monitor', at script init we might broadcast +In our example of the 'foo monitor', at script initialisation we might broadcast the template as follows: \begin{verbatim}