Arthur Axel 'fREW' Schmidt
|
cf81341fc9
|
Surface {when} in local time for weather widget
Here's how I use this:
local weather_widget = function(
code,
url,
name
)
local actual_widget = wibox.widget.textbox()
local actual_tooltip = awful.tooltip({ objects = { actual_widget } });
actual_widget:buttons(awful.util.table.join(
awful.button({}, 1, function () awful.spawn("firefox '" .. url .. os.time() .. "'") end)
))
vicious.register(actual_widget, vicious.widgets.weather,
function (widget, args)
actual_tooltip:set_text(
"City: " .. args["{city}"] ..
"\nWind: " .. args["{windmph}"] .. "mph " ..
"\nSky: " .. args["{sky}"] ..
"\nHumidity: " .. args["{humid}"] ..
"\nMeasured at: " .. os.date("%F %T", args["{when}"]))
return name .. " " .. args["{tempf}"] .. "°F"
end, 60 * 10, code)
return actual_widget
end
|
2019-05-21 21:31:28 +07:00 |