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