diff --git a/drawing/filesystem.lua b/drawing/filesystem.lua index c643462..b8ef880 100644 --- a/drawing/filesystem.lua +++ b/drawing/filesystem.lua @@ -5,12 +5,14 @@ local geometry = require 'geometry' local pure = require 'pure' local impure = require 'impure' -return function(paths) +return function(pathspecs) local MODULE_Y = 170 local SPACING = 20 local BAR_PAD = 100 local SEPARATOR_SPACING = 20 + local paths, names = table.unpack(pure.unzip(pathspecs)) + ----------------------------------------------------------------------------- -- header @@ -49,7 +51,7 @@ return function(paths) BAR_Y, geometry.SECTION_WIDTH, BAR_PAD, - {'root', 'boot', 'home', 'data', 'dcache', 'tmpfs'}, + names, SPACING, 12, 80 diff --git a/drawing/readwrite.lua b/drawing/readwrite.lua index 87a2fe1..0e0df1b 100644 --- a/drawing/readwrite.lua +++ b/drawing/readwrite.lua @@ -6,6 +6,7 @@ local sys = require 'sys' return function(update_freq, devices) local PLOT_SEC_BREAK = 20 local PLOT_HEIGHT = 56 + -- TODO currently this will find any block device local DEVICE_PATHS = sys.get_disk_paths(devices) local init_read_bytes, init_write_bytes = sys.get_total_disk_io(DEVICE_PATHS) diff --git a/main.lua b/main.lua index dff8401..5ee66bd 100644 --- a/main.lua +++ b/main.lua @@ -37,7 +37,14 @@ function conky_start(update_interval) local update_freq = 1 / update_interval local devices = {'sda', 'nvme0n1'} local battery = 'BAT0' - local fs_paths = {'/', '/boot', '/home', '/mnt/data', '/mnt/dcache', "/tmp"} + local fs_paths = { + {'/', 'root'}, + {'/boot', 'boot'}, + {'/home', 'home'}, + {'/mnt/data', 'data'}, + {'/mnt/dcache', 'dcache'}, + {'/tmp', 'tmpfs'} + } local mem = memory(update_freq) local rw = readwrite(update_freq, devices)