aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2012-06-25 00:39:23 +0200
committerAdrian C. (anrxc) <anrxc@sysphere.org>2012-06-25 00:39:23 +0200
commite1c7c4772a8c1c651964bbcfbcdc0dc5d47d6dc4 (patch)
tree2b7736f11525b20bc5a942ddea86351d6d11b6b5 /widgets
parent1a7b43068c4cfbb7baa3f781fb7d65a708f63a5c (diff)
downloadvicious-legacy-e1c7c4772a8c1c651964bbcfbcdc0dc5d47d6dc4.tar.xz
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)
Diffstat (limited to 'widgets')
-rw-r--r--widgets/os.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/widgets/os.lua b/widgets/os.lua
index 288fcd4..52180e3 100644
--- a/widgets/os.lua
+++ b/widgets/os.lua
@@ -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"]}