README.md: update examples awesome v4 api

This commit is contained in:
Jörg Thalheim 2017-07-09 19:39:30 +01:00 committed by GitHub
parent aabb3d3ae5
commit fe10ee8201
1 changed files with 8 additions and 8 deletions

View File

@ -588,7 +588,7 @@ order to actually display them.
**Date widget** **Date widget**
```Lua ```Lua
datewidget = widget({ type = "textbox" }) datewidget = wibox.widget.textbox()
vicious.register(datewidget, vicious.widgets.date, "%b %d, %R") vicious.register(datewidget, vicious.widgets.date, "%b %d, %R")
``` ```
@ -598,7 +598,7 @@ date sequences as the format string
**Memory widget** **Memory widget**
```Lua ```Lua
memwidget = widget({ type = "textbox" }) memwidget = wibox.widget.textbox()
vicious.cache(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)
``` ```
@ -609,7 +609,7 @@ values and enables caching of this widget type
**HDD temperature widget** **HDD temperature widget**
```Lua ```Lua
hddtempwidget = widget({ type = "textbox" }) hddtempwidget = wibox.widget.textbox()
vicious.register(hddtempwidget, vicious.widgets.hddtemp, "${/dev/sda} °C", 19) vicious.register(hddtempwidget, vicious.widgets.hddtemp, "${/dev/sda} °C", 19)
``` ```
@ -620,7 +620,7 @@ not provide the port argument so default port is used
**Mbox widget** **Mbox widget**
```Lua ```Lua
mboxwidget = widget({ type = "textbox" }) mboxwidget = wibox.widget.textbox()
vicious.register(mboxwidget, vicious.widgets.mbox, "$1", 5, "/home/user/mail/Inbox") vicious.register(mboxwidget, vicious.widgets.mbox, "$1", 5, "/home/user/mail/Inbox")
``` ```
updated every 5 seconds, provides full path to the mbox as an updated every 5 seconds, provides full path to the mbox as an
@ -694,7 +694,7 @@ widget.
**Example** **Example**
```Lua ```Lua
mpdwidget = widget({ type = "textbox" }) mpdwidget = wibox.widget.textbox()
vicious.register(mpdwidget, vicious.widgets.mpd, vicious.register(mpdwidget, vicious.widgets.mpd,
function (widget, args) function (widget, args)
if args["{state}"] == "Stop" then return "" if args["{state}"] == "Stop" then return ""
@ -708,7 +708,7 @@ seconds (the default interval)
**Example** **Example**
```Lua ```Lua
uptimewidget = widget({ type = "textbox" }) uptimewidget = wibox.widget.textbox()
vicious.register(uptimewidget, vicious.widgets.uptime, vicious.register(uptimewidget, vicious.widgets.uptime,
function (widget, args) function (widget, args)
return string.format("Uptime: %2dd %02d:%02d ", args[1], args[2], args[3]) return string.format("Uptime: %2dd %02d:%02d ", args[1], args[2], args[3])
@ -724,7 +724,7 @@ automatically adapted to text width).
**Example** **Example**
```Lua ```Lua
uptimewidget = widget({ type = "textbox" }) uptimewidget = wibox.widget.textbox()
uptimewidget.width, uptimewidget.align = 50, "right" uptimewidget.width, uptimewidget.align = 50, "right"
vicious.register(uptimewidget, vicious.widgets.uptime, "$1 $2:$3", 61) vicious.register(uptimewidget, vicious.widgets.uptime, "$1 $2:$3", 61)
``` ```
@ -738,7 +738,7 @@ it.
**Example** **Example**
```Lua ```Lua
ctext = widget({ type = "textbox"}) ctext = wibox.widget.textbox()
cgraph = awful.widget.graph() cgraph = awful.widget.graph()
cgraph:set_width(100):set_height(20) cgraph:set_width(100):set_height(20)
cgraph:set_stack(true):set_max_value(100) cgraph:set_stack(true):set_max_value(100)