Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets

This commit is contained in:
streetturtle 2020-07-14 10:44:45 -04:00
commit 50fbb55299
2 changed files with 10 additions and 4 deletions

View File

@ -101,8 +101,8 @@ weather_curl_widget({
...
--default
weather_widget({
api_key='<your-key>',
coordinates = {45.5017, -73.5673},
api_key='c3d7320b359da4e48c2d682a04076576',
}),
,
--customized
@ -123,4 +123,4 @@ weather_curl_widget({
## How it works
TBW
TBW

View File

@ -393,7 +393,9 @@ local function worker(args)
local function update_widget(widget, stdout, stderr)
if stderr ~= '' then
if not warning_shown then
show_warning(stderr)
if stderr ~= 'curl: (52) Empty reply from server' then
show_warning(stderr)
end
warning_shown = true
widget:is_ok(false)
tooltip:add_to_object(widget)
@ -450,7 +452,11 @@ local function worker(args)
end)))
-- watch('cat /home/pmakhov/.config/awesome/awesome-wm-widgets/weather-widget/weather.json', 5, update_widget, weather_widget)
watch(string.format(GET_FORECAST_CMD, owm_one_cal_api), 5, update_widget, weather_widget)
watch(
string.format(GET_FORECAST_CMD, owm_one_cal_api),
120, -- API limit is 1k req/day; day has 1440 min; every 2 min is good
update_widget, weather_widget,
)
return weather_widget
end