mirror of https://github.com/lcpz/lain.git
#121: io.read abbreviations removed
This commit is contained in:
parent
c6fadc6871
commit
293091d267
|
@ -27,7 +27,7 @@ local function worker(args)
|
|||
|
||||
function abase.update()
|
||||
async.request(cmd, function(f)
|
||||
output = f:read("*a")
|
||||
output = f:read("*all")
|
||||
f:close()
|
||||
widget = abase.widget
|
||||
settings()
|
||||
|
|
|
@ -33,7 +33,7 @@ local function worker(args)
|
|||
|
||||
function alsa.update()
|
||||
local f = assert(io.popen(string.format("%s get %s", alsa.cmd, alsa.channel)))
|
||||
local mixer = f:read("*a")
|
||||
local mixer = f:read("*all")
|
||||
f:close()
|
||||
|
||||
volume_now = {}
|
||||
|
|
|
@ -117,7 +117,7 @@ local function worker(args)
|
|||
function alsabar.update()
|
||||
-- Get mixer control contents
|
||||
local f = assert(io.popen(string.format("%s get %s", alsabar.cmd, alsabar.channel)))
|
||||
local mixer = f:read("*a")
|
||||
local mixer = f:read("*all")
|
||||
f:close()
|
||||
|
||||
-- Capture mixer control state: [5%] ... ... [on]
|
||||
|
|
|
@ -26,7 +26,7 @@ local function worker(args)
|
|||
|
||||
function base.update()
|
||||
local f = assert(io.popen(cmd))
|
||||
output = f:read("*a")
|
||||
output = f:read("*all")
|
||||
f:close()
|
||||
widget = base.widget
|
||||
settings()
|
||||
|
|
|
@ -85,7 +85,7 @@ function calendar:show(t_out, inc_offset, scr)
|
|||
.. calendar.font_size .. "'><b>"
|
||||
.. f:read() .. "</b>\n\n"
|
||||
.. f:read() .. "\n"
|
||||
.. f:read("*a"):gsub("\n*$", "")
|
||||
.. f:read("*all"):gsub("\n*$", "")
|
||||
.. "</span></tt>"
|
||||
f:close()
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ function fs:show(t_out)
|
|||
fs:hide()
|
||||
|
||||
local f = io.popen(helpers.scripts_dir .. "dfs")
|
||||
ws = f:read("*a"):gsub("\n*$", "")
|
||||
ws = f:read("*all"):gsub("\n*$", "")
|
||||
f:close()
|
||||
|
||||
notification = naughty.notify({
|
||||
|
|
|
@ -42,7 +42,7 @@ local function worker(args)
|
|||
if not is_plain
|
||||
then
|
||||
local f = io.popen(password)
|
||||
password = f:read("*a"):gsub("\n", "")
|
||||
password = f:read("*all"):gsub("\n", "")
|
||||
f:close()
|
||||
end
|
||||
|
||||
|
@ -58,7 +58,7 @@ local function worker(args)
|
|||
head_command, server, port, mail, password, request)
|
||||
|
||||
async.request(curl, function(f)
|
||||
ws = f:read("*a")
|
||||
ws = f:read("*all")
|
||||
f:close()
|
||||
|
||||
_, mailcount = string.gsub(ws, "%d+", "")
|
||||
|
|
|
@ -53,7 +53,7 @@ local function worker(args)
|
|||
local np = io.popen("find " .. line ..
|
||||
"/new -mindepth 1 -type f " ..
|
||||
"-not -name '.*' -printf a")
|
||||
local mailstring = np:read("*a")
|
||||
local mailstring = np:read("*all")
|
||||
|
||||
-- Strip off leading mailpath.
|
||||
local box = string.match(line, mailpath .. "/*([^/]+)")
|
||||
|
|
|
@ -29,7 +29,7 @@ local net = {
|
|||
|
||||
function net.get_device()
|
||||
f = io.popen("ip link show | cut -d' ' -f2,9")
|
||||
ws = f:read("*a")
|
||||
ws = f:read("*all")
|
||||
f:close()
|
||||
ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN")
|
||||
if ws ~= nil then
|
||||
|
|
|
@ -29,7 +29,7 @@ local function worker(args)
|
|||
|
||||
function update()
|
||||
local f = io.open("/proc/loadavg")
|
||||
local ret = f:read("*a")
|
||||
local ret = f:read("*all")
|
||||
f:close()
|
||||
|
||||
load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
|
||||
|
|
|
@ -31,7 +31,7 @@ local function worker(args)
|
|||
local f = io.open(tempfile)
|
||||
if f ~= nil
|
||||
then
|
||||
coretemp_now = tonumber(f:read("*a")) / 1000
|
||||
coretemp_now = tonumber(f:read("*all")) / 1000
|
||||
f:close()
|
||||
else
|
||||
coretemp_now = "N/A"
|
||||
|
|
|
@ -71,7 +71,7 @@ local function worker(args)
|
|||
function weather.forecast_update()
|
||||
local cmd = string.format(forecast_call, city_id, units, lang, cnt)
|
||||
async.request(cmd, function(f)
|
||||
j = f:read("*a")
|
||||
j = f:read("*all")
|
||||
f:close()
|
||||
weather_now, pos, err = json.decode(j, 1, nil)
|
||||
|
||||
|
@ -79,7 +79,7 @@ local function worker(args)
|
|||
weather.notification_text = ''
|
||||
for i = 1, weather_now["cnt"] do
|
||||
local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"])))
|
||||
day = string.gsub(f:read("*a"), "\n", "")
|
||||
day = string.gsub(f:read("*all"), "\n", "")
|
||||
f:close()
|
||||
|
||||
tmin = math.floor(weather_now["list"][i]["temp"]["min"])
|
||||
|
@ -103,7 +103,7 @@ local function worker(args)
|
|||
function weather.update()
|
||||
local cmd = string.format(current_call, city_id, units, lang)
|
||||
async.request(cmd, function(f)
|
||||
j = f:read("*a")
|
||||
j = f:read("*all")
|
||||
f:close()
|
||||
weather_now, pos, err = json.decode(j, 1, nil)
|
||||
|
||||
|
|
Loading…
Reference in New Issue