Skip to content

Commit ad71a6b

Browse files
author
copycat-killer
committed
dfs: fix misalignments; widgets/weather: added APPID argument
1 parent 9c40d29 commit ad71a6b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

scripts/dfs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ echo "$SORTED_FILE_SYSTEMS_INFO" | $AWK_COMMAND -v DEBUG=$DEBUG -v PATTERN=$PATT
212212
printf ("\n%s", narrow_margin);
213213
else
214214
printf ("%-*s", LEFT_COLUMN + 2, "");
215-
print " Used Free Total ";
215+
print " Used Free Total ";
216216
if (! NARROW_MODE)
217217
print "";
218218
}
@@ -352,7 +352,7 @@ $0 ~ PATTERN {
352352
# printf ("stars_number = %d\n", stars_number);
353353
354354
printf ("|");
355-
for (i = 1; i <= stars_number; i++)
355+
for (i = 1; i <= stars_number && i <= 49; i++)
356356
{
357357
printf ("%s", "*");
358358
}

widgets/weather.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ local setmetatable = setmetatable
3030
local function worker(args)
3131
local weather = {}
3232
local args = args or {}
33+
local APPID = args.APPID or 1 -- mandatory
3334
local timeout = args.timeout or 900 -- 15 min
3435
local timeout_forecast = args.timeout or 86400 -- 24 hrs
35-
local current_call = "curl -s 'http://api.openweathermap.org/data/2.5/weather?id=%s&units=%s&lang=%s'"
36-
local forecast_call = "curl -s 'http://api.openweathermap.org/data/2.5/forecast/daily?id=%s&units=%s&lang=%s&cnt=%s'"
36+
local current_call = "curl -s 'http://api.openweathermap.org/data/2.5/weather?id=%s&units=%s&lang=%s&APPID=%s'"
37+
local forecast_call = "curl -s 'http://api.openweathermap.org/data/2.5/forecast/daily?id=%s&units=%s&lang=%s&cnt=%s&APPID=%s'"
3738
local city_id = args.city_id or 0 -- placeholder
3839
local units = args.units or "metric"
3940
local lang = args.lang or "en"
@@ -83,7 +84,7 @@ local function worker(args)
8384
end
8485

8586
function weather.forecast_update()
86-
local cmd = string.format(forecast_call, city_id, units, lang, cnt)
87+
local cmd = string.format(forecast_call, city_id, units, lang, cnt, APPID)
8788
async.request(cmd, function(f)
8889
local pos, err
8990
weather_now, pos, err = json.decode(f, 1, nil)
@@ -112,7 +113,7 @@ local function worker(args)
112113
end
113114

114115
function weather.update()
115-
local cmd = string.format(current_call, city_id, units, lang)
116+
local cmd = string.format(current_call, city_id, units, lang, APPID)
116117
async.request(cmd, function(f)
117118
local pos, err
118119
weather_now, pos, err = json.decode(f, 1, nil)

0 commit comments

Comments
 (0)