os: change os.getenv init to allow standalone usage of os widget
Test case: lua> foo = require("vicious.widgets.os") lua> print(foo()[1]) /usr/share/lua/5.1/vicious/widgets/os.lua:66: attempt to call field 'getenv' (a nil value)
This commit is contained in:
parent
1a7b43068c
commit
e1c7c4772a
|
@ -7,8 +7,8 @@
|
|||
local pairs = pairs
|
||||
local tonumber = tonumber
|
||||
local io = { popen = io.popen }
|
||||
local os = { getenv = os.getenv }
|
||||
local math = { ceil = math.ceil }
|
||||
local los = { getenv = os.getenv }
|
||||
local setmetatable = setmetatable
|
||||
local helpers = require("vicious.helpers")
|
||||
local string = {
|
||||
|
@ -63,7 +63,7 @@ local function worker(format)
|
|||
end
|
||||
|
||||
-- Get user from the environment
|
||||
system["username"] = os.getenv("USER")
|
||||
system["username"] = los.getenv("USER")
|
||||
|
||||
return {system["ostype"], system["osrelease"], system["username"],
|
||||
system["hostname"], system["entropy"], system["entropy_p"]}
|
||||
|
|
Loading…
Reference in New Issue