aboutsummaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-15 03:02:50 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2010-03-15 03:02:50 +0100
commit49b1b0972f7db6ef77b459e3010c3b569fa69534 (patch)
tree14205aa46f1ae3c889b9665a9333721576b92bbc /widgets
parent7cbf987a2a22d69de6a5194bb7d8c685f8d6b62e (diff)
downloadvicious-legacy-49b1b0972f7db6ef77b459e3010c3b569fa69534.tar.xz
helpers: index subdirectories in pathtotable()
Diffstat (limited to 'widgets')
-rw-r--r--widgets/dio.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/widgets/dio.lua b/widgets/dio.lua
index 64a56e1..e886dac 100644
--- a/widgets/dio.lua
+++ b/widgets/dio.lua
@@ -28,7 +28,6 @@ local function worker(format, disk)
local disk_lines = { [disk] = {} }
local disk_stats = helpers.pathtotable("/sys/block/" .. disk)
- local disk_queue = helpers.pathtotable("/sys/block/" .. disk .. "/queue")
if disk_stats.stat then
local match = string.gmatch(disk_stats.stat, "[%s]+([%d]+)")
@@ -62,8 +61,8 @@ local function worker(format, disk)
helpers.uformat(disk_usage[disk], "total", diff_total[disk][7] + diff_total[disk][3], unit)
-- Store I/O scheduler
- if disk_queue.scheduler then
- disk_usage[disk]["{sched}"] = string.gmatch(disk_queue.scheduler, "%[([%a]+)%]")
+ if disk_stats.queue.scheduler then
+ disk_usage[disk]["{sched}"] = string.gmatch(disk_stats.queue.scheduler, "%[([%a]+)%]")
end
return disk_usage[disk]