API: function enable_caching() is now cache()
This commit is contained in:
parent
9371839401
commit
5226d10c27
4
README
4
README
|
@ -78,7 +78,7 @@ Restart suspended widgets:
|
||||||
- if widget is provided only that widget will be activated
|
- if widget is provided only that widget will be activated
|
||||||
|
|
||||||
Enable caching for a widget:
|
Enable caching for a widget:
|
||||||
vicious.enable_caching(widget_type)
|
vicious.cache(widget_type)
|
||||||
|
|
||||||
- enable caching of values returned by a widget type
|
- enable caching of values returned by a widget type
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ Date widget
|
||||||
|
|
||||||
Memory widget
|
Memory widget
|
||||||
memwidget = widget({ type = 'textbox' })
|
memwidget = widget({ type = 'textbox' })
|
||||||
vicious.enable_caching(vicious.widgets.mem)
|
vicious.cache(vicious.widgets.mem)
|
||||||
vicious.register(memwidget, vicious.widgets.mem, '$1 ($2MB/$3MB)', 13)
|
vicious.register(memwidget, vicious.widgets.mem, '$1 ($2MB/$3MB)', 13)
|
||||||
|
|
||||||
- updated every 13 seconds, appends "MB" to 2nd and 3rd returned
|
- updated every 13 seconds, appends "MB" to 2nd and 3rd returned
|
||||||
|
|
2
init.lua
2
init.lua
|
@ -207,7 +207,7 @@ end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Enable caching for a widget
|
-- {{{ Enable caching for a widget
|
||||||
function enable_caching(widget)
|
function cache(widget)
|
||||||
if widget_cache[widget] == nil then
|
if widget_cache[widget] == nil then
|
||||||
widget_cache[widget] = {}
|
widget_cache[widget] = {}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue