aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-02-04 21:01:15 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-02-04 21:01:15 +0100
commit0f3123eb8bf555406df446ddbc17801a48826694 (patch)
treee73de2a003f4449afb5741fd07acc5d5b185aafb /README
parent3095ffbcd5537f43572e87413e2187e8cee057c0 (diff)
downloadvicious-legacy-0f3123eb8bf555406df446ddbc17801a48826694.tar.xz
README: added textbox fixed width example
Diffstat (limited to 'README')
-rw-r--r--README15
1 files changed, 14 insertions, 1 deletions
diff --git a/README b/README
index 8761735..4d4c78b 100644
--- a/README
+++ b/README
@@ -357,7 +357,7 @@ battery widget when it goes below a certain point, hide widgets when
they return a certain value or maybe use string.format for padding.
- Do not confuse this with just coloring the widget, in those cases
- standard markup can be inserted into the format string.
+ standard pango markup can be inserted into the format string.
The format function will get the widget as its first argument, table
with the values otherwise inserted into the format string as its
@@ -386,6 +386,19 @@ Example
- uses string.format for padding uptime values to a minimum amount
of digits, updated every 61 seconds
+When it comes to padding it is also useful to mention how a widget can
+be configured to have a fixed width. You can set a fixed width on your
+textbox widgets by changing their .width field (by default width is
+automatically adapted to text width).
+
+Example
+ uptimewidget = widget({ type = 'textbox' })
+ uptimewidget.width, uptimewidget.align = 50, 'right'
+ vicious.register(uptimewidget, vicious.widgets.uptime, '$1 $2:$3', 61)
+
+ - forces a fix width of 50px to the uptime widget, and aligns its
+ text to the right
+
Other
-----