summaryrefslogtreecommitdiffhomepage
path: root/README
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-10-03 13:08:14 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-10-03 13:08:14 +0200
commit8768241ed9f2537fa01028e6e43edb71354f3ef3 (patch)
treecc4ddc4174c0302772fee7ed035e0f552b06acb9 /README
parentd7778c081a053cf571b041ed6f6d21c11e502912 (diff)
downloadxmobar-8768241ed9f2537fa01028e6e43edb71354f3ef3.tar.gz
xmobar-8768241ed9f2537fa01028e6e43edb71354f3ef3.tar.bz2
README: updated to recent API change
darcs-hash:20071003110814-d6583-3bfbbcd810259ab545645ee62ce4b162ef39eb6e.gz
Diffstat (limited to 'README')
-rw-r--r--README17
1 files changed, 13 insertions, 4 deletions
diff --git a/README b/README
index 4205d87..1db127b 100644
--- a/README
+++ b/README
@@ -267,14 +267,23 @@ Writing a plugin for Xmobar should be very simple. You need to create
a data type with at least one constructor.
Next you must declare this data type an instance of the Exec class, by
-defining the 1 needed method (start) and one optional one (alias):
+defining the 1 needed method (alternatively "start" or "run") and one
+optional one (alias):
- start :: e -> (String -IO ()) -> IO ()
+ start :: e -> (String -> IO ()) -> IO ()
+ run :: e -> IO String
alias :: e -> String
"start" must receive a callback to be used to display the String
-produced by the plugin. "alias" is the name to be used in the output
-template. Default alias will be the data type constructor.
+produced by the plugin. This method can be used for plugins that need
+to perform asynchronous actions, or that need to set a refresh rate.
+See Plugins/Date.hs or Plugins/PipeReader.hs for examples.
+
+"run" can be used for simpler plugins, that must be run every second.
+See Plugins/HelloWorld.hs for an example.
+
+"alias" is the name to be used in the output template. Default alias
+will be the data type constructor.
That requires importing the plugin API (the Exec class definition),
that is exported by Plugins.hs. So you just need to import it in your