X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=statusd.tex;h=82e70ebab75f9ae9b1f78b643d2acf0979b7782c;hb=6121e0e6f3aea3e43bf6d432fdd474566fd08a16;hp=e1fe6b2f5a4f02605701a061b93e7507000e27b5;hpb=6e84dc8312f2fdb5b8b7467a0279afd5b2df107f;p=ion3-doc.git 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}