Permalink
Browse files

Merge pull request #2 from igrat/master

systemload show_only_recent won't work
  • Loading branch information...
2 parents 4d5d344 + 58155c5 commit 7ee380cc4aaf62fd19a9132d402309264555415b @vain committed Feb 5, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 README.md
  2. +5 −5 vain/widgets.lua
View
@@ -368,7 +368,7 @@ The function takes a table as an optional argument. That table may
contain:
.refresh_timeout: Defaults to 10 seconds.
- .show_only_recent: Show all three values or only the first one?
+ .show_all: Show all three values or by default only the first one?
## memusage
Show used memory and total memory in MiB. Read from `/proc/meminfo`.
View
@@ -20,21 +20,21 @@ terminal = ''
function systemload(args)
local args = args or {}
local refresh_timeout = args.refresh_timeout or 10
- local only_show_recent = args.only_show_recent or true
+ local show_all = args.show_all or false
local mysysload = widget({ type = "textbox" })
local mysysloadupdate = function()
local f = io.open("/proc/loadavg")
local ret = f:read("*all")
f:close()
- if only_show_recent
+ if show_all
then
- local a = string.match(ret, "([^%s]+) ")
- mysysload.text = string.format("%s", a)
- else
local a, b, c = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)")
mysysload.text = string.format("%s %s %s", a, b, c)
+ else
+ local a = string.match(ret, "([^%s]+) ")
+ mysysload.text = string.format("%s", a)
end
mysysload.text = ' <span color="' .. beautiful.fg_urgent .. '">'
.. mysysload.text .. '</span> '

0 comments on commit 7ee380c

Please sign in to comment.