I am configuring the widgets in awesome wm (v3.5.5-1) using vicious (v2.1.3-1). I want to show the time in a widget. And then show the date in the tooltip when I hover over the time widget.
The following code using vicious in my rc.lua file works fine:
myclock = wibox.widget.textbox()
vicious.register(myclock, vicious.widgets.date, " <span color='#ffffff'>%H:%M</span> ")
myclock_tooltip = awful.tooltip ({ objects = { myclock } })
vicious.register(myclock_tooltip, vicious.widgets.date, " %a %d %b ", 60)
However, when I try to combine the two vicious.register
statements (based on the Format functions section of the vicious readme file):
myclock = wibox.widget.textbox()
myclock_tooltip = awful.tooltip ({ objects = { myclock } })
vicious.register(myclock, vicious.widgets.date,
function (widget, args)
myclock_tooltip.set_text(" %a %d %b ")
return " <span color='#ffffff'>%H:%M</span> "
end)
I get the following error:
/usr/share/lua/5.2/vicious/widgets/date.lua:23: bad argument #1 to 'date' (string expected, got function)
Any suggestions where I'm going wrong?