aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2012-01-20 14:35:07 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2012-01-20 14:35:07 +0100
commit73db82b4c9cec2b966b0beff2153b9678aa44e48 (patch)
treeb10955959908884d0038f2c6b8a523adff96bd15
parent7e81bb8a95f2407b6502f0040dd70bcb6a44ba65 (diff)
downloadvicious-legacy-73db82b4c9cec2b966b0beff2153b9678aa44e48.tar.xz
README: add format function example for overriding symbols
-rw-r--r--README14
1 files changed, 14 insertions, 0 deletions
diff --git a/README b/README
index bdd1ac4..35dc285 100644
--- a/README
+++ b/README
@@ -510,6 +510,20 @@ Example
cores on a single graph, the textbox "ctext" is just an empty
placeholder, graph is updated every 3 seconds
+A lot of users are not happy with default symbols used in volume,
+battery, cpufreq and other widget types. You can use your own symbols
+without any need to modify modules.
+
+ volumewidget = widget({ type = "textbox"})
+ vicious.register(volumewidget, vicious.widgets.volume,
+ function(widget, args)
+ local label = { ["♫"] = "O", ["♩"] = "M" }
+ return "Volume: " .. args[1] .. "% State: " .. label[args[2]]
+ end, 2, "PCM")
+
+ - uses a custom table map to modify symbols representing the mixer
+ state; on or off/mute
+
Other
-----