[helpers.lua] Removed old sysctl functions

This commit is contained in:
mutlusun 2019-07-31 18:26:06 +02:00
parent d6e21f71d0
commit 875e98e24e
No known key found for this signature in database
GPG Key ID: C0AF8F434E1AB79B
2 changed files with 5 additions and 38 deletions

View File

@ -26,6 +26,11 @@ Fixed:
- [pkg,weather,contrib/btc] Allow function call without Awesome
- [pkg] Use more updated front-ends for Debian/Ubuntu (apt) and Fedora (dnf)
Removed:
- `helpers.sysctl` and `helpers.sysctl_table` were removed in favour of
`helpers.sysctl_async`.
# Changes in 2.3.3
Feature: Add battery widget type for OpenBSD

View File

@ -226,44 +226,6 @@ function helpers.scroll(text, maxlen, widget)
end
-- }}}
-- {{{ Return result from one sysctl variable as string
function helpers.sysctl(path)
local fd = io.popen("sysctl -n " .. helpers.shellquote(path))
if not fd then
return
end
local ret = fd:read()
fd:close()
return ret
end
-- }}}
-- {{{ Return result from multiple sysctl variables as table
function helpers.sysctl_table(syspath)
return setmetatable({ _path = syspath },
{ __index = function(table, index)
local path = "sysctl -n " .. helpers.shellquote(table._path .. "." .. index)
local f = io.popen(path)
if f then
local s = f:read("*all")
f:close()
if select(2, s:gsub("\n", "\n")) > 1 then
local o = { _path = path}
setmetatable(o, getmetatable(table))
return o
else
return s
end
end
end
})
end
-- }}}
-- {{{ Return result from sysctl variable as table (async)
function helpers.sysctl_async(path_table, parse)
local ret = {}