diff options
author | streetturtle <streetturtle@gmail.com> | 2020-07-14 10:44:45 -0400 |
---|---|---|
committer | streetturtle <streetturtle@gmail.com> | 2020-07-14 10:44:45 -0400 |
commit | 50fbb5529901346bce0bd6858b17c344e33fc5a4 (patch) | |
tree | 7272e3cfa6fcc092173ec14446dbec30b21bfffe | |
parent | f0524d3a679652a062c8f0515200ebc31430fb5d (diff) | |
parent | 3b7311a9481fab1f60f2fe06e0396b941733437f (diff) |
Merge branch 'master' of github.com:streetturtle/awesome-wm-widgets
-rw-r--r-- | weather-widget/README.md | 4 | ||||
-rw-r--r-- | weather-widget/weather.lua | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/weather-widget/README.md b/weather-widget/README.md index defe1b7..2adbe7a 100644 --- a/weather-widget/README.md +++ b/weather-widget/README.md @@ -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
\ No newline at end of file +TBW diff --git a/weather-widget/weather.lua b/weather-widget/weather.lua index 4fcdba7..07849c9 100644 --- a/weather-widget/weather.lua +++ b/weather-widget/weather.lua @@ -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 |