From 633a3a7e6b18fbaa7dbb463b0214841ea7b77e85 Mon Sep 17 00:00:00 2001 From: frosty Date: Sat, 24 Aug 2024 04:13:46 -0400 Subject: [PATCH] remove example config, and add some info --- README.md | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index c7e6341..82db474 100644 --- a/README.md +++ b/README.md @@ -19,42 +19,8 @@ Usage of modbot: -x set x root window name ``` -## Example +## Information -### Configuration - -```go -var ( - delim = []byte("] [") - prefix = []byte("[") - suffix = []byte("]") -) - -var modules = []Module{ - { - Func: readers.ReadCpuUsage(), - Interval: 5 * time.Second, - Template: `CPU {{printf "%.0f" .UsagePercent}}%`, - }, - { - Func: readers.ReadBattery("BAT1"), - Interval: 60 * time.Second, - Template: "BAT {{.Capacity}}%", - }, - { - Func: readers.ReadDate("15:04:05"), - Interval: 1 * time.Second, - }, - { - Func: readers.ReadLoad(), - Interval: 5 * time.Second, - Template: "{{.OneMinute}}", - }, -} -``` - -### Output - -``` -[CPU 8%] [BAT 100%] [03:15:57] [0.62] -``` +* If an empty string is returned from a module, then the corresponding module will not be displayed. +* If a module returns a non-`nil` value for its error, or if the exit code of an exec module is non-zero, then `failed` will be shown for the corresponding module. +* Modules can be updated on an interval, signal, or both.