[awesome] Defaulting to daytime icons
Defaulting to daytime icons until is_daytime functionality is fixed
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
@ -122,7 +122,7 @@ local function factory(args)
|
|||
if not err and type(sun_position) == "table" then
|
||||
local sunrise = tonumber(sun_position["daily"]["data"][1]["sunriseTime"])
|
||||
local sunset = tonumber(sun_position["daily"]["data"][1]["sunsetTime"])
|
||||
local icon = sun_position["daily"]["icon"]
|
||||
icon = sun_position["daily"]["icon"]
|
||||
local loc_now = os.time()
|
||||
|
||||
if sunrise <= loc_now and loc_now <= sunset then
|
||||
|
@ -146,30 +146,30 @@ local function factory(args)
|
|||
print("****DEBUG**** weather_now: ", weather_now["currently"]["temperature"])
|
||||
|
||||
if not err and type(weather_now) == "table" then
|
||||
--[[
|
||||
is_daytime, icon, err = weather.is_daytime()
|
||||
print("****DEBUG**** is_daytime, icon, err: ", is_daytime, icon, err)
|
||||
if not err and type(icon) == "string" then
|
||||
if is_daytime then
|
||||
icon = string.gsub(weather_now["currently"]["icon"], "n", "d")
|
||||
print("****DEBUG**** weather-now-icon: ", weather_now["currently"]["icon"])
|
||||
if
|
||||
not err --[[and type(icon) == "string"--]]
|
||||
then
|
||||
if is_daytime == nil or is_daytime then
|
||||
icon = string.gsub(weather_now["currently"]["icon"], "night", "day")
|
||||
else
|
||||
icon = string.gsub(icon, "d", "n")
|
||||
icon = string.gsub(weather_now["currently"]["icon"], "day", "night")
|
||||
end
|
||||
|
||||
weather.icon_path = icons_path .. icon .. ".png"
|
||||
--]]
|
||||
print("****DEBUG**** weather_update if-arm")
|
||||
widget = weather.widget
|
||||
settings()
|
||||
-- end
|
||||
weather.icon_path = icons_path .. icon .. ".png"
|
||||
print("****DEBUG**** weather_update if-arm")
|
||||
widget = weather.widget
|
||||
settings()
|
||||
end
|
||||
else
|
||||
print("****DEBUG**** err: " .. err .. " ; type: " .. type(weather_now))
|
||||
weather.icon_path = icons_path .. "na.png"
|
||||
weather.widget:set_markup(weather_na_markup)
|
||||
end
|
||||
--]]
|
||||
|
||||
-- weather.icon:set_image(weather.icon_path)
|
||||
weather.icon:set_image(weather.icon_path)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|