clean up dead code

This commit is contained in:
petrucci4prez 2017-07-16 14:54:15 -04:00
parent 2fc23a0672
commit 72998b1890
2 changed files with 1 additions and 29 deletions

2
core

@ -1 +1 @@
Subproject commit 391c9179765e2bb70e1b458aadef58d7b96bb934 Subproject commit 466d19425481babffe1367f50cccb62593ce013d

View File

@ -15,10 +15,8 @@ local FS_PATHS = {'/', '/boot', '/var', '/home', '/mnt/data', '/usr/local/opt'}
local FS_NUM = #FS_PATHS local FS_NUM = #FS_PATHS
local FS_REGEX = '^([%d%p]-)(%a+)' local FS_REGEX = '^([%d%p]-)(%a+)'
--construction params
local MODULE_Y = 165 local MODULE_Y = 165
local SPACING = 20 local SPACING = 20
--~ local TEXT_WIDTH = 220
local BAR_PAD = 100 local BAR_PAD = 100
local header = Widget.Header{ local header = Widget.Header{
@ -42,34 +40,15 @@ local labels = Widget.TextColumn{
'lopt' 'lopt'
} }
--~ local totals = {}
--~ for i = 1, FS_NUM do
--~ totals[i] = Widget.CriticalText{
--~ x = _G_INIT_DATA_.RIGHT_X + TEXT_WIDTH,
--~ y = HEADER_BOTTOM_Y + (i - 1) * SPACING,
--~ x_align = 'right',
--~ text_color = schema.blue,
--~ }
--~ end
--~ local units = {}
--~ local conky_used = {}
local conky_used_perc = {} local conky_used_perc = {}
for i, v in _PAIRS(FS_PATHS) do for i, v in _PAIRS(FS_PATHS) do
--~ local size, unit = _STRING_MATCH(util.conky('${fs_size '..v..'}'), FS_REGEX)
--~ totals[i].append_end = ' / '..size..' ('..unit..')'
--~ units[i] = unit
--~ conky_used[i] = '${fs_used '..v..'}'
conky_used_perc[i] = '${fs_used_perc '..v..'}' conky_used_perc[i] = '${fs_used_perc '..v..'}'
end end
local bars = Widget.CompoundBar{ local bars = Widget.CompoundBar{
--~ x = _G_INIT_DATA_.RIGHT_X + TEXT_WIDTH + BAR_PAD,
x = _G_INIT_DATA_.RIGHT_X + BAR_PAD, x = _G_INIT_DATA_.RIGHT_X + BAR_PAD,
y = HEADER_BOTTOM_Y, y = HEADER_BOTTOM_Y,
--~ length = _G_INIT_DATA_.SECTION_WIDTH - (TEXT_WIDTH + BAR_PAD),
length = _G_INIT_DATA_.SECTION_WIDTH - BAR_PAD, length = _G_INIT_DATA_.SECTION_WIDTH - BAR_PAD,
spacing = SPACING, spacing = SPACING,
num_bars = FS_NUM, num_bars = FS_NUM,
@ -88,11 +67,7 @@ HEADER_BOTTOM_Y = nil
local __update = function(cr) local __update = function(cr)
for i = 1, FS_NUM do for i = 1, FS_NUM do
--~ local value, unit = _STRING_MATCH(util.conky(conky_used[i]), FS_REGEX)
local percent = util.conky_numeric(conky_used_perc[i]) local percent = util.conky_numeric(conky_used_perc[i])
--~ local force = 1
--~ if percent > 80 then force = 0 end
--~ CriticalText.set(totals[i], cr, util.precision_convert_bytes(value, unit, units[i], 3), force)
CompoundBar.set(bars, i, percent * 0.01) CompoundBar.set(bars, i, percent * 0.01)
end end
end end
@ -108,9 +83,6 @@ local draw = function(cr, current_interface, trigger)
Text.draw(header.text, cr) Text.draw(header.text, cr)
Line.draw(header.underline, cr) Line.draw(header.underline, cr)
TextColumn.draw(labels, cr) TextColumn.draw(labels, cr)
--~ for i = 1, FS_NUM do
--~ CriticalText.draw(totals[i], cr)
--~ end
CompoundBar.draw(bars, cr) CompoundBar.draw(bars, cr)
end end
end end