Error in weather widget
oxysoft opened this issue · comments
Nicolas Martel commented
Stacktrace
stack traceback:
/usr/share/awesome/lib/naughty/core.lua:436: in upvalue 'set_timeout'
/usr/share/awesome/lib/naughty/core.lua:703: in function 'naughty.notify'
/home/nuck/.config/awesome/lain/widget/weather.lua:66: in field '?'
/usr/share/awesome/lib/wibox/widget/base.lua:482: in upvalue 'drill'
/usr/share/awesome/lib/wibox/widget/base.lua:495: in upvalue 'drill'
/usr/share/awesome/lib/wibox/widget/base.lua:495: in upvalue 'drill'
/usr/share/awesome/lib/wibox/widget/base.lua:531: in function 'wibox.setup'
/home/nuck/.config/awesome/themes/steamburn/theme.lua:300: in field 'at_screen_connect'
/home/nuck/.config/awesome/rc.lua:324: in local 'func'
/usr/share/awesome/lib/awful/screen.lua:438: in function 'awful.screen.connect_for_each_screen'
/home/nuck/.config/awesome/rc.lua:322: in main chunk
error: /usr/share/awesome/lib/naughty/core.lua:436: attempt to compare number with table
Info
➜ awesome -v
awesome v4.3 (Too long)
• Compiled against Lua 5.3.3 (running with Lua 5.3)
• D-Bus support: ✔
• execinfo support: ✔
• xcb-randr version: 1.6
• LGI version: 0.9.2
~ via ⬢ v10.19.0
➜ lua -v
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
I get the same error with both of these when adding to the wibox:
-- Weather (simplest test case)
theme.weather = lain.widget.weather({
city_id = 2643743, -- placeholder (London)
})
-- Weather (template from awesome-copycats)
theme.weather = lain.widget.weather({
city_id = 2643743, -- placeholder (London)
notification_preset = { font = "Terminus 10", fg = theme.fg_normal },
weather_na_markup = markup.fontfg(theme.font, "#eca4c4", "N/A "),
settings = function()
descr = weather_now["weather"][1]["description"]:lower()
units = math.floor(weather_now["main"]["temp"])
widget:set_markup(markup.fontfg(theme.font, "#eca4c4", descr .. " @ " .. units .. "°C "))
end
})
Any ideas? Cheers!
Luca CPZ commented
Nicolas Martel commented
Yup, that works perfectly now!