X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/3f854a45f578f0a93d9f561bb8d7f574ab5675ee..586c54a25750fd90d91c15ac8eb818b2613de582:/widget/weather.lua diff --git a/widget/weather.lua b/widget/weather.lua index 1b2e80f..1098146 100644 --- a/widget/weather.lua +++ b/widget/weather.lua @@ -6,25 +6,24 @@ --]] -local helpers = require("lain.helpers") -local json = require("lain.util").dkjson -local focused = require("awful.screen").focused -local naughty = require("naughty") -local wibox = require("wibox") -local math = { floor = math.floor } -local os = { time = os.time, - date = os.date, - difftime = os.difftime } -local string = { format = string.format, - gsub = string.gsub } -local tonumber = tonumber -local setmetatable = setmetatable +local helpers = require("lain.helpers") +local json = require("lain.util").dkjson +local focused = require("awful.screen").focused +local naughty = require("naughty") +local wibox = require("wibox") +local math = { floor = math.floor } +local os = { time = os.time, + date = os.date, + difftime = os.difftime } +local string = { format = string.format, + gsub = string.gsub } +local tonumber = tonumber -- OpenWeatherMap -- current weather and X-days forecast -- lain.widget.weather -local function worker(args) +local function factory(args) local weather = { widget = wibox.widget.textbox() } local args = args or {} local APPID = args.APPID or "3e321f9414eaedbfab34983bda77a66e" -- lain default @@ -171,4 +170,4 @@ local function worker(args) return weather end -return setmetatable({}, { __call = function(_, ...) return worker(...) end }) +return factory