REF remove dead code

This commit is contained in:
Nathan Dwarshuis 2021-07-11 17:14:06 -04:00
parent 30a39aa34b
commit 073e7239d1
5 changed files with 1 additions and 231 deletions

2
core

@ -1 +1 @@
Subproject commit d21bbf57059f91a63e01fdb874f02e2c603cb85b
Subproject commit b3e511fb82aa9886b8f24f520fce2c3cb8473121

View File

@ -12,8 +12,6 @@ local ScalePlot = require 'ScalePlot'
local HEADER_HEIGHT = 45
local HEADER_FONT_SIZE = 15
-- TODO move all this font stuff to the theme file
-- local HEADER_FONT_SLANT = CAIRO_FONT_SLANT_NORMAL
-- local HEADER_FONT_WEIGHT = CAIRO_FONT_WEIGHT_BOLD
local HEADER_UNDERLINE_CAP = CAIRO_LINE_CAP_ROUND
local HEADER_UNDERLINE_OFFSET = -20
local HEADER_UNDERLINE_THICKNESS = 3
@ -65,18 +63,6 @@ M.Header = function(x, y, w, s)
local underline_y = bottom_y + HEADER_UNDERLINE_OFFSET
local obj = {
-- text = _G_Widget_.Text{
-- x = x,
-- y = y,
-- text = s,
-- font_spec = M.make_font_spec(_G_Patterns_.FONT, HEADER_FONT_SIZE, true),
-- -- font_size = HEADER_FONT_SIZE,
-- x_align = 'left',
-- y_align = 'top',
-- text_color = _G_Patterns_.HEADER_FG,
-- -- slant = HEADER_FONT_SLANT,
-- -- weight = HEADER_FONT_WEIGHT
-- },
text = _G_Widget_.plainText(
_G_Widget_.make_point(x, y),
s,
@ -88,13 +74,6 @@ M.Header = function(x, y, w, s)
)
),
bottom_y = bottom_y,
-- underline = _G_Widget_.Line{
-- p1 = {x = x, y = underline_y},
-- p2 = {x = x + w, y = underline_y},
-- thickness = HEADER_UNDERLINE_THICKNESS,
-- line_pattern = _G_Patterns_.HEADER_FG,
-- cap = HEADER_UNDERLINE_CAP
-- }
underline = _G_Widget_.Line(
_G_Widget_.make_point(x, underline_y),
_G_Widget_.make_point(x + w, underline_y),
@ -135,18 +114,6 @@ M.percent_label_style = _G_Widget_.label_style(
)
M.initThemedLabelPlot = function(x, y, w, h, label_style)
-- return _G_Widget_.LabelPlot{
-- x = x,
-- y = y,
-- width = w,
-- height = h,
-- outline_pattern = _G_Patterns_.BORDER_FG,
-- intrvl_pattern = _G_Patterns_.BORDER_FG,
-- data_line_pattern = _G_Patterns_.PLOT_FILL_BORDER_PRIMARY,
-- data_fill_pattern = _G_Patterns_.PLOT_FILL_BG_PRIMARY,
-- label_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- label_font_spec = M.label_font_spec,
-- }
return _G_Widget_.LabelPlot(
_G_Widget_.make_box(_G_Widget_.make_point(x, y), w, h),
M.default_plot_style,
@ -159,14 +126,6 @@ end
M.initPercentPlot = function(x, y, w, h, spacing, label)
return {
-- label = _G_Widget_.Text{
-- x = x,
-- y = y,
-- text = label,
-- x_align = 'left',
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- font_spec = M.normal_font_spec,
-- },
label = _left_text(_G_Widget_.make_point(x, y), label),
value = _G_Widget_.formattedThresholdText(
_G_Widget_.make_point(x + w, y),
@ -178,17 +137,6 @@ M.initPercentPlot = function(x, y, w, h, spacing, label)
80
)
),
-- value = _G_Widget_.CriticalText{
-- x = x + w,
-- y = y,
-- x_align = 'right',
-- y_align = 'center',
-- append_end = '%',
-- critical_limit = 80,
-- text_color = _G_Patterns_.PRIMARY_FG,
-- critical_color = _G_Patterns_.PRIMARY_FG,
-- font_spec = M.normal_font_spec,
-- },
plot = M.initThemedLabelPlot(
x,
y + spacing,
@ -220,19 +168,6 @@ end
M.base_2_scale_data = _G_Widget_.scale_data(2, 1, 0.9)
M.initThemedScalePlot = function(x, y, w, h, f)
-- return _G_Widget_.ScalePlot{
-- x = x,
-- y = y,
-- width = w,
-- height = h,
-- y_label_func = f,
-- outline_pattern = _G_Patterns_.BORDER_FG,
-- intrvl_pattern = _G_Patterns_.BORDER_FG,
-- data_line_pattern = _G_Patterns_.PLOT_FILL_BORDER_PRIMARY,
-- data_fill_pattern = _G_Patterns_.PLOT_FILL_BG_PRIMARY,
-- label_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- label_font_spec = M.label_font_spec,
-- }
return _G_Widget_.ScalePlot(
_G_Widget_.make_box(_G_Widget_.make_point(x, y), w, h),
M.default_plot_style,
@ -251,25 +186,10 @@ end
M.initLabeledScalePlot = function(x, y, w, h, f, spacing, label)
return {
-- label = _G_Widget_.Text{
-- x = x,
-- y = y,
-- text = label,
-- x_align = 'left',
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- font_spec = M.normal_font_spec,
-- },
label = _left_text(
_G_Widget_.make_point(x, y),
label
),
-- value = _G_Widget_.Text{
-- x = x + w,
-- y = y,
-- x_align = 'right',
-- text_color = _G_Patterns_.PRIMARY_FG,
-- font_spec = M.normal_font_spec,
-- },
value = _right_text(
_G_Widget_.make_point(x + w, y),
label
@ -317,17 +237,6 @@ end
M.initTextRing = function(x, y, r, fmt, limit)
return {
ring = M.initRing(x, y, r),
-- value = _G_Widget_.CriticalText{
-- x = x,
-- y = y,
-- x_align = 'center',
-- y_align = 'center',
-- append_end = append_end,
-- critical_limit = limit,
-- text_color = _G_Patterns_.PRIMARY_FG,
-- critical_color = _G_Patterns_.CRITICAL_FG,
-- font_spec = M.normal_font_spec,
-- },
value = _G_Widget_.formattedThresholdText(
_G_Widget_.make_point(x, y),
nil,
@ -362,11 +271,6 @@ end
-- separator (eg a horizontal line)
M.initSeparator = function(x, y, w)
-- return _G_Widget_.Line{
-- p1 = {x = x, y = y},
-- p2 = {x = x + w, y = y},
-- line_pattern = _G_Patterns_.BORDER_FG,
-- }
return _G_Widget_.Line(
_G_Widget_.make_point(x, y),
_G_Widget_.make_point(x + w, y),
@ -384,26 +288,10 @@ end
M.initTextRow = function(x, y, w, label)
return {
-- label = _G_Widget_.Text{
-- x = x,
-- y = y,
-- x_align = 'left',
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- text = label,
-- font_spec = M.normal_font_spec,
-- },
label = _left_text(
_G_Widget_.make_point(x, y),
label
),
-- value = _G_Widget_.Text{
-- x = x + w,
-- y = y,
-- x_align = 'right',
-- text_color = _G_Patterns_.PRIMARY_FG,
-- text = "<NA>",
-- font_spec = M.normal_font_spec,
-- }
value = _right_text(
_G_Widget_.make_point(x + w, y),
nil
@ -429,30 +317,10 @@ end
-- TODO add limit to this
M.initTextRowCrit = function(x, y, w, label, append_end, limit)
return{
-- label = _G_Widget_.Text{
-- x = x,
-- y = y,
-- text = label,
-- x_align = 'left',
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- font_spec = M.normal_font_spec,
-- },
label = _left_text(
_G_Widget_.make_point(x, y),
label
),
-- value = _G_Widget_.CriticalText{
-- x = x + w,
-- y = y,
-- x_align = 'right',
-- y_align = 'center',
-- text_color = _G_Patterns_.PRIMARY_FG,
-- critical_color = _G_Patterns_.CRITICAL_FG,
-- critical_limit = limit,
-- append_end = append_end,
-- text = '<NA>',
-- font_spec = M.normal_font_spec,
-- }
value = _G_Widget_.formattedThresholdText(
_G_Widget_.make_point(x + w, y),
nil,
@ -487,30 +355,12 @@ end
M.initTextRows = function(x, y, w, spacing, labels)
return {
labels = _G_Widget_.TextColumn(
-- x = x,
-- y = y,
-- spacing = spacing,
-- x_align = 'left',
-- y_align = 'center',
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- font_spec = M.normal_font_spec,
-- table.unpack(labels),
_G_Widget_.make_point(x, y),
labels,
M.left_text_style,
nil,
spacing
),
-- values = _G_Widget_.TextColumn{
-- x = x + w,
-- y = y,
-- spacing = spacing,
-- x_align = 'right',
-- y_align = 'center',
-- text_color = _G_Patterns_.PRIMARY_FG,
-- font_spec = M.normal_font_spec,
-- num_rows = #labels,
-- }
values = _G_Widget_.initTextColumnN(
_G_Widget_.make_point(x + w, y),
#labels,
@ -562,20 +412,6 @@ M.default_table_style = _G_Widget_.table_style(
)
M.initTable = function(x, y, w, h, n, labels)
-- return _G_Widget_.Table{
-- x = x,
-- y = y,
-- width = w,
-- height = h,
-- num_rows = n,
-- body_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- header_color = _G_Patterns_.PRIMARY_FG,
-- line_pattern = _G_Patterns_.BORDER_FG,
-- separator_pattern = _G_Patterns_.BORDER_FG,
-- body_font_spec = M.make_font_spec(_G_Patterns_.FONT, 11, false),
-- header_font_spec = M.make_font_spec(_G_Patterns_.FONT, 11, false),
-- table.unpack(labels),
-- }
return _G_Widget_.Table(
_G_Widget_.make_box(_G_Widget_.make_point(x, y), w, h),
n,

View File

@ -45,19 +45,6 @@ local separator = Common.initSeparator(
local _BAR_Y_ = _SEP_Y_ + _SEPARATOR_SPACING_
-- local bars = _G_Widget_.CompoundBar{
-- x = _G_INIT_DATA_.RIGHT_X + _BAR_PAD_,
-- y = _BAR_Y_,
-- length = _G_INIT_DATA_.SECTION_WIDTH - _BAR_PAD_,
-- spacing = _SPACING_,
-- num_bars = FS_NUM,
-- -- thickness = 12,
-- critical_limit = 0.8,
-- indicator_pattern = Patterns.INDICATOR_FG_PRIMARY,
-- critical_pattern = Patterns.INDICATOR_FG_CRITICAL,
-- line_pattern = Patterns.INDICATOR_BG,
-- }
local bars = _G_Widget_.CompoundBar(
_G_Widget_.make_point(
_G_INIT_DATA_.RIGHT_X + _BAR_PAD_,
@ -79,21 +66,6 @@ local bars = _G_Widget_.CompoundBar(
false
)
-- local labels = _G_Widget_.TextColumn{
-- x = _G_INIT_DATA_.RIGHT_X,
-- y = _BAR_Y_,
-- spacing = _SPACING_,
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- font_spec = Common.normal_font_spec,
-- x_align = 'left',
-- y_align = 'center',
-- 'root',
-- 'boot',
-- 'home',
-- 'data',
-- 'dcache',
-- 'tmpfs',
-- }
local labels = _G_Widget_.TextColumn(
_G_Widget_.make_point(
_G_INIT_DATA_.RIGHT_X,

View File

@ -106,32 +106,6 @@ local swap = Common.initTextRowCrit(
80
)
-- local cache = {
-- labels = _G_Widget_.TextColumn{
-- x = _TEXT_LEFT_X_,
-- y = _LINE_1_Y_ + _TEXT_SPACING_,
-- spacing = _TEXT_SPACING_,
-- text_color = _G_Patterns_.INACTIVE_TEXT_FG,
-- font_spec = Common.normal_font_spec,
-- x_align = 'left',
-- y_align = 'center',
-- 'Page Cache',
-- 'Buffers',
-- 'Kernel Slab'
-- },
-- percents = _G_Widget_.TextColumn{
-- x = _RIGHT_X_,
-- y = _LINE_1_Y_ + _TEXT_SPACING_,
-- x_align = 'right',
-- y_align = 'center',
-- append_end = ' %',
-- text_color = _G_Patterns_.SECONDARY_FG,
-- font_spec = Common.normal_font_spec,
-- '<cached_kb>',
-- '<buffers_kb>',
-- '<kernel_slab>'
-- },
-- }
local cache = {
labels = _G_Widget_.TextColumn(
_G_Widget_.make_point(

View File

@ -56,18 +56,6 @@ local _create_core_ = function(cores, id, x, y)
end
cores[id +1] = {
-- dials = _G_Widget_.CompoundDial{
-- x = x,
-- y = y,
-- inner_radius = _DIAL_INNER_RADIUS_,
-- outer_radius = _DIAL_OUTER_RADIUS_,
-- spacing = _DIAL_SPACING_,
-- num_dials = NUM_THREADS_PER_CORE,
-- critical_limit = 0.8,
-- critical_pattern = _G_Patterns_.INDICATOR_FG_CRITICAL,
-- dial_pattern = _G_Patterns_.INDICATOR_FG_PRIMARY,
-- arc_pattern = _G_Patterns_.INDICATOR_BG
-- },
dials = _G_Widget_.CompoundDial(
_G_Widget_.make_semicircle(
_G_Widget_.make_point(x, y),