diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-09-25 21:31:20 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-09-25 21:31:20 +0200 |
commit | 46a7241015e33778f3174b65272ede2bb24c0252 (patch) | |
tree | 1ca300b8680851783e9098476b0789dd9e23f0cf | |
parent | eadf0c93e1448197178ef71ddba8e1e8f64683ae (diff) | |
download | vicious-legacy-46a7241015e33778f3174b65272ede2bb24c0252.tar.xz |
README: added more caching information
-rw-r--r-- | README | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -72,6 +72,12 @@ Restart suspended widgets: widget - if provided, only that widget will be activated +Enable caching for a widget: + + vicious.enable_caching(widget_type) + + - enable caching of values returned by a widget type + Power ----- @@ -80,9 +86,10 @@ of wake-ups and also be very expensive for system resources. This is especially important when running on battery power. Suspending widgets is one way to prevent widgets from draining your battery. -Vicious also caches all widget types. Caching enables you to have -multiple widgets using the same widget type and its worker function -will be executed only once. +Vicious can also cache values returned by widget types. Caching +enables you to have multiple widgets using the same widget type and +its worker function will be executed only once. It is useful mostly +for widgets which do not require a special argument to be passed. Update intervals also play a big role, and you can save a lot of power with a smart approach to intervals. You should avoid intervals like: @@ -249,10 +256,11 @@ MPD widget Memory widget memwidget = widget({ type = 'textbox', name = 'memwidget' }) + vicious.enable_caching(vicious.widgets.mem) vicious.register(memwidget, vicious.widgets.mem, '$1 ($2MB/$3MB)', 13) - executed every 13 seconds, appends "MB" to 2nd and 3rd returned - values + values and enables caching of this widget type HDD temperature widget hddtempwidget = widget({ type = 'textbox', name = 'hddtempwidget' }) |