Merge branch 'use_dhall'
This commit is contained in:
commit
e517b31ea5
|
@ -0,0 +1,323 @@
|
|||
let Vector2 = \(a : Type) -> { x : a, y : a }
|
||||
|
||||
let Point = Vector2 Natural
|
||||
|
||||
let Margin = Vector2 Natural
|
||||
|
||||
let FSPath = { name : Text, path : Text }
|
||||
|
||||
let TextGeo = { Type = { text_spacing : Natural }, default.text_spacing = 20 }
|
||||
|
||||
let SepGeo = { Type = { sep_spacing : Natural }, default.sep_spacing = 20 }
|
||||
|
||||
let PlotGeo_ =
|
||||
{ Type = { sec_break : Natural, height : Natural, ticks_y : Natural }
|
||||
, default = { sec_break = 20, height = 56, ticks_y = 4 }
|
||||
}
|
||||
|
||||
let PlotGeo = { Type = { plot : PlotGeo_.Type }, default.plot = PlotGeo_::{=} }
|
||||
|
||||
let TableGeo_ = { Type = { sec_break : Natural }, default.sec_break = 20 }
|
||||
|
||||
let TableGeo =
|
||||
{ Type = { table : TableGeo_.Type }, default.table = TableGeo_::{=} }
|
||||
|
||||
let FSGeo =
|
||||
{ Type = { bar_spacing : Natural, bar_pad : Natural } //\\ SepGeo.Type
|
||||
, default = { bar_spacing = 20, bar_pad = 100 } /\ SepGeo::{=}
|
||||
}
|
||||
|
||||
let GfxGeo =
|
||||
{ Type = SepGeo.Type //\\ PlotGeo.Type //\\ TextGeo.Type
|
||||
, default = SepGeo::{=} /\ PlotGeo::{=} /\ TextGeo::{=}
|
||||
}
|
||||
|
||||
let MemGeo =
|
||||
{ Type = TextGeo.Type //\\ PlotGeo.Type //\\ TableGeo.Type
|
||||
, default = TextGeo::{=} /\ PlotGeo::{=} /\ TableGeo::{=}
|
||||
}
|
||||
|
||||
let ProcGeo =
|
||||
{ Type = GfxGeo.Type //\\ TableGeo.Type
|
||||
, default = GfxGeo::{=} /\ TableGeo::{=}
|
||||
}
|
||||
|
||||
let PwrGeo =
|
||||
{ Type = TextGeo.Type //\\ PlotGeo.Type
|
||||
, default = TextGeo::{=} /\ PlotGeo::{=}
|
||||
}
|
||||
|
||||
let FileSystem =
|
||||
{ Type =
|
||||
{ show_smart : Bool, fs_paths : List FSPath, geometry : FSGeo.Type }
|
||||
, default.geometry = FSGeo::{=}
|
||||
}
|
||||
|
||||
let Graphics =
|
||||
{ Type =
|
||||
{ dev_power : Text
|
||||
, show_temp : Bool
|
||||
, show_clock : Bool
|
||||
, show_gpu_util : Bool
|
||||
, show_mem_util : Bool
|
||||
, show_vid_util : Bool
|
||||
, geometry : GfxGeo.Type
|
||||
}
|
||||
, default.geometry = GfxGeo::{=}
|
||||
}
|
||||
|
||||
let Memory =
|
||||
{ Type =
|
||||
{ show_stats : Bool
|
||||
, show_plot : Bool
|
||||
, show_swap : Bool
|
||||
, table_rows : Natural
|
||||
, geometry : MemGeo.Type
|
||||
}
|
||||
, default.geometry = MemGeo::{=}
|
||||
}
|
||||
|
||||
let Network =
|
||||
{ Type = { geometry : PlotGeo.Type }, default.geometry = PlotGeo::{=} }
|
||||
|
||||
let Processor =
|
||||
{ Type =
|
||||
{ core_rows : Natural
|
||||
, core_padding : Natural
|
||||
, show_stats : Bool
|
||||
, show_plot : Bool
|
||||
, table_rows : Natural
|
||||
, geometry : ProcGeo.Type
|
||||
}
|
||||
, default.geometry = ProcGeo::{=}
|
||||
}
|
||||
|
||||
let RaplSpec = { name : Text, address : Text }
|
||||
|
||||
let Pacman =
|
||||
{ Type = { geometry : TextGeo.Type }, default.geometry = TextGeo::{=} }
|
||||
|
||||
let Power =
|
||||
{ Type =
|
||||
{ battery : Text, rapl_specs : List RaplSpec, geometry : PwrGeo.Type }
|
||||
, default.geometry = PwrGeo::{=}
|
||||
}
|
||||
|
||||
let ReadWrite =
|
||||
{ Type = { devices : List Text, geometry : PlotGeo.Type }
|
||||
, default.geometry = PlotGeo::{=}
|
||||
}
|
||||
|
||||
let System = Pacman
|
||||
|
||||
let ModType =
|
||||
< filesystem : FileSystem.Type
|
||||
| graphics : Graphics.Type
|
||||
| memory : Memory.Type
|
||||
| network : Network.Type
|
||||
| pacman : Pacman.Type
|
||||
| processor : Processor.Type
|
||||
| power : Power.Type
|
||||
| readwrite : ReadWrite.Type
|
||||
| system : System.Type
|
||||
>
|
||||
|
||||
let Annotated = \(a : Type) -> { type : Text, data : a }
|
||||
|
||||
let Block = < Pad : Natural | Mod : Annotated ModType >
|
||||
|
||||
let Column_ = { blocks : List Block, width : Natural }
|
||||
|
||||
let Column = < CPad : Natural | CCol : Column_ >
|
||||
|
||||
let Panel_ = { columns : List Column, margins : Margin }
|
||||
|
||||
let Panel = < PPad : Natural | PPanel : Panel_ >
|
||||
|
||||
let Layout = { anchor : Point, panels : List Panel }
|
||||
|
||||
let Sizes =
|
||||
{ Type =
|
||||
{ normal : Natural
|
||||
, plot_label : Natural
|
||||
, table : Natural
|
||||
, header : Natural
|
||||
}
|
||||
, default = { normal = 13, plot_label = 8, table = 11, header = 15 }
|
||||
}
|
||||
|
||||
let Font =
|
||||
{ Type = { family : Text, sizes : Sizes.Type }
|
||||
, default = { family = "Neuropolitical", sizes = Sizes::{=} }
|
||||
}
|
||||
|
||||
let PlotGeometry =
|
||||
{ Type = { seconds : Natural, ticks_x : Natural }
|
||||
, default = { seconds = 90, ticks_x = 9 }
|
||||
}
|
||||
|
||||
let TableGeometry =
|
||||
{ Type =
|
||||
{ name_chars : Natural
|
||||
, padding : Margin
|
||||
, header_padding : Natural
|
||||
, row_spacing : Natural
|
||||
}
|
||||
, default =
|
||||
{ name_chars = 8
|
||||
, padding = { x = 6, y = 15 }
|
||||
, header_padding = 20
|
||||
, row_spacing = 16
|
||||
}
|
||||
}
|
||||
|
||||
let HeaderGeometry =
|
||||
{ Type = { underline_offset : Natural, padding : Natural }
|
||||
, default = { underline_offset = 26, padding = 19 }
|
||||
}
|
||||
|
||||
let Geometry =
|
||||
{ Type =
|
||||
{ plot : PlotGeometry.Type
|
||||
, table : TableGeometry.Type
|
||||
, header : HeaderGeometry.Type
|
||||
}
|
||||
, default =
|
||||
{ plot = PlotGeometry::{=}
|
||||
, table = TableGeometry::{=}
|
||||
, header = HeaderGeometry::{=}
|
||||
}
|
||||
}
|
||||
|
||||
let StopRGB = { color : Natural, stop : Double }
|
||||
|
||||
let StopRGBA = { color : Natural, stop : Double, alpha : Double }
|
||||
|
||||
let ColorAlpha = { color : Natural, alpha : Double }
|
||||
|
||||
let Pattern =
|
||||
< RGB : Natural
|
||||
| RGBA : ColorAlpha
|
||||
| GradientRGB : List StopRGB
|
||||
| GradientRGBA : List StopRGBA
|
||||
>
|
||||
|
||||
let annotatePattern =
|
||||
\(a : Pattern) ->
|
||||
{ type = showConstructor a, data = a } : Annotated Pattern
|
||||
|
||||
let mod = \(a : ModType) -> Block.Mod { type = showConstructor a, data = a }
|
||||
|
||||
let APattern = Annotated Pattern
|
||||
|
||||
let symGradient =
|
||||
\(c0 : Natural) ->
|
||||
\(c1 : Natural) ->
|
||||
annotatePattern
|
||||
( Pattern.GradientRGB
|
||||
[ { color = c0, stop = 0.0 }
|
||||
, { color = c1, stop = 0.5 }
|
||||
, { color = c0, stop = 1.0 }
|
||||
]
|
||||
)
|
||||
|
||||
let Patterns =
|
||||
{ Type =
|
||||
{ header : APattern
|
||||
, panel : { bg : APattern }
|
||||
, text :
|
||||
{ active : APattern, inactive : APattern, critical : APattern }
|
||||
, border : APattern
|
||||
, plot :
|
||||
{ grid : APattern
|
||||
, outline : APattern
|
||||
, data : { border : APattern, fill : APattern }
|
||||
}
|
||||
, indicator :
|
||||
{ bg : APattern, fg : { active : APattern, critical : APattern } }
|
||||
}
|
||||
, default =
|
||||
{ header = annotatePattern (Pattern.RGB 0xefefef)
|
||||
, panel.bg
|
||||
= annotatePattern (Pattern.RGBA { color = 0x121212, alpha = 0.7 })
|
||||
, text =
|
||||
{ active = annotatePattern (Pattern.RGB 0xbfe1ff)
|
||||
, inactive = annotatePattern (Pattern.RGB 0xc8c8c8)
|
||||
, critical = annotatePattern (Pattern.RGB 0xff8282)
|
||||
}
|
||||
, border = annotatePattern (Pattern.RGB 0x888888)
|
||||
, plot =
|
||||
{ grid = annotatePattern (Pattern.RGB 0x666666)
|
||||
, outline = annotatePattern (Pattern.RGB 0x777777)
|
||||
, data =
|
||||
{ border =
|
||||
annotatePattern
|
||||
( Pattern.GradientRGB
|
||||
[ { color = 0x003f7c, stop = 0.0 }
|
||||
, { color = 0x1e90ff, stop = 1.0 }
|
||||
]
|
||||
)
|
||||
, fill =
|
||||
annotatePattern
|
||||
( Pattern.GradientRGBA
|
||||
[ { color = 0x316ece, stop = 0.2, alpha = 0.5 }
|
||||
, { color = 0x8cc7ff, stop = 1.0, alpha = 1.0 }
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
, indicator =
|
||||
{ bg = symGradient 0x565656 0xbfbfbf
|
||||
, fg =
|
||||
{ active = symGradient 0x316BA6 0x99CEFF
|
||||
, critical = symGradient 0xFF3333 0xFFB8B8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let Theme =
|
||||
{ Type =
|
||||
{ font : Font.Type
|
||||
, geometry : Geometry.Type
|
||||
, patterns : Patterns.Type
|
||||
}
|
||||
, default =
|
||||
{ font = Font::{=}, geometry = Geometry::{=}, patterns = Patterns::{=} }
|
||||
}
|
||||
|
||||
let Bootstrap = { update_interval : Natural, dimensions : Point }
|
||||
|
||||
let Config = { bootstrap : Bootstrap, theme : Theme.Type, layout : Layout }
|
||||
|
||||
let toConfig =
|
||||
\(i : Natural) ->
|
||||
\(x : Natural) ->
|
||||
\(y : Natural) ->
|
||||
\(t : Theme.Type) ->
|
||||
\(l : Layout) ->
|
||||
{ bootstrap = { update_interval = i, dimensions = { x, y } }
|
||||
, theme = t
|
||||
, layout = l
|
||||
}
|
||||
: Config
|
||||
|
||||
in { toConfig
|
||||
, Block
|
||||
, Column
|
||||
, ModType
|
||||
, Layout
|
||||
, Panel
|
||||
, FSPath
|
||||
, FileSystem
|
||||
, Graphics
|
||||
, Memory
|
||||
, Network
|
||||
, Pacman
|
||||
, Processor
|
||||
, Power
|
||||
, ReadWrite
|
||||
, System
|
||||
, Theme
|
||||
, mod
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
let C = ./config.dhall
|
||||
|
||||
let memory =
|
||||
C.ModType.memory
|
||||
C.Memory::{
|
||||
, show_stats = False
|
||||
, show_swap = False
|
||||
, show_plot = True
|
||||
, table_rows = 3
|
||||
}
|
||||
|
||||
let processor =
|
||||
C.ModType.processor
|
||||
C.Processor::{
|
||||
, core_rows = 0
|
||||
, core_padding = 0
|
||||
, show_stats = False
|
||||
, show_plot = True
|
||||
, table_rows = 3
|
||||
}
|
||||
|
||||
let layout =
|
||||
{ anchor = { x = 12, y = 11 }
|
||||
, panels =
|
||||
[ C.Panel.PPanel
|
||||
{ columns =
|
||||
[ C.Column.CCol
|
||||
{ blocks =
|
||||
[ C.mod (C.ModType.network C.Network::{=})
|
||||
, C.Block.Pad 10
|
||||
, C.mod memory
|
||||
, C.Block.Pad 10
|
||||
, C.mod processor
|
||||
]
|
||||
, width = 436
|
||||
}
|
||||
]
|
||||
, margins = { x = 20, y = 10 }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
in C.toConfig 1 1920 1080 C.Theme::{=} layout
|
40
conky.conf
40
conky.conf
|
@ -55,37 +55,25 @@ package.cpath = conky_dir..'lib/lib/lua/5.4/?.so;'
|
|||
local yaml = require 'lyaml'
|
||||
local i_o = require 'i_o'
|
||||
|
||||
local schema_path = conky_dir..'/config/schema.yml'
|
||||
local validate_config
|
||||
local config_path = '/tmp/conky.yml'
|
||||
|
||||
if i_o.exe_exists('yajsv') then
|
||||
validate_config = function(config_path)
|
||||
local cmd = string.format('yajsv -q -s %s %s', schema_path, config_path)
|
||||
return i_o.exit_code_cmd(cmd) == 0
|
||||
end
|
||||
else
|
||||
validate_config = function(_)
|
||||
i_o.warnf('could not validate config')
|
||||
return true
|
||||
end
|
||||
local try_read_config = function(path)
|
||||
local cmd = string.format('dhall-to-yaml --file %s > %s', path, config_path)
|
||||
return i_o.exit_code_cmd(cmd)
|
||||
end
|
||||
|
||||
local find_valid_config = function(paths)
|
||||
for i = 1, #paths do
|
||||
local path = paths[i]
|
||||
local r = i_o.read_file(path)
|
||||
if r ~= nil then
|
||||
if validate_config(path) then
|
||||
local rc = try_read_config(path)
|
||||
if rc == 0 then
|
||||
i_o.infof('Using config at %s', path)
|
||||
return path, yaml.load(r)
|
||||
return yaml.load(i_o.read_file(config_path))
|
||||
else
|
||||
i_o.warnf('%s did not pass; trying next', path)
|
||||
end
|
||||
else
|
||||
i_o.infof('could not find %s; trying next', path)
|
||||
i_o.warnf('could not read %s; trying next', path)
|
||||
end
|
||||
end
|
||||
i_o.assertf(false, 'ERROR: could not load valid config')
|
||||
i_o.assertf(false, 'could not load valid config')
|
||||
end
|
||||
|
||||
local get_config_dir = function()
|
||||
|
@ -93,11 +81,11 @@ local get_config_dir = function()
|
|||
end
|
||||
|
||||
local try_config_paths = {
|
||||
get_config_dir()..'conky.yml',
|
||||
conky_dir..'config/fallback.yml'
|
||||
get_config_dir()..'conky.dhall',
|
||||
conky_dir..'config/fallback.dhall'
|
||||
}
|
||||
|
||||
local config_path, config = find_valid_config(try_config_paths)
|
||||
local config = find_valid_config(try_config_paths)
|
||||
|
||||
local bootstrap = config.bootstrap
|
||||
|
||||
|
@ -125,8 +113,8 @@ conky.config = {
|
|||
xinerama_head = 0,
|
||||
|
||||
double_buffer = true,
|
||||
minimum_width = bootstrap.dimensions[1],
|
||||
minimum_height = bootstrap.dimensions[2],
|
||||
minimum_width = bootstrap.dimensions.x,
|
||||
minimum_height = bootstrap.dimensions.y,
|
||||
|
||||
draw_shades = false,
|
||||
draw_outline = false,
|
||||
|
|
|
@ -61,14 +61,14 @@ local compile_patterns
|
|||
compile_patterns = function(patterns)
|
||||
local r = {}
|
||||
for k, v in pairs(patterns) do
|
||||
if type(v) == "number" then
|
||||
r[k] = rgb(v)
|
||||
elseif v.color ~= nil then
|
||||
r[k] = rgba(v.color, v.alpha)
|
||||
elseif v.gradient ~= nil then
|
||||
r[k] = compile_gradient(v.gradient)
|
||||
elseif v.gradient_alpha ~= nil then
|
||||
r[k] = compile_gradient_alpha(v.gradient_alpha)
|
||||
if v.type == "RGB" then
|
||||
r[k] = rgb(v.data)
|
||||
elseif v.type == "RGBA" then
|
||||
r[k] = rgba(v.data.color, v.data.alpha)
|
||||
elseif v.type == "GradientRGB" then
|
||||
r[k] = compile_gradient(v.data)
|
||||
elseif v.type == "GradientRGBA" then
|
||||
r[k] = compile_gradient_alpha(v.data)
|
||||
else
|
||||
r[k] = compile_patterns(v)
|
||||
end
|
||||
|
|
|
@ -18,7 +18,8 @@ local reduce_modules_y = function(common_, modlist, init_x, width, acc, new)
|
|||
if type(new) == "number" then
|
||||
acc.next_y = acc.next_y + new
|
||||
else
|
||||
local m = modlist[new](common_, width, geom.make_point(init_x, acc.next_y))
|
||||
local m = modlist[new.type](new.data, common_, width, geom.make_point(init_x, acc.next_y))
|
||||
-- local m = modlist[new](common_, width, geom.make_point(init_x, acc.next_y))
|
||||
local r = common_.compile_module(
|
||||
m.header,
|
||||
m.point,
|
||||
|
@ -99,8 +100,8 @@ local reduce_static = function(common_, mods, y, acc, panel_mods)
|
|||
acc.next_x = acc.next_x + panel_mods
|
||||
else
|
||||
local margins = panel_mods.margins
|
||||
local margin_x = margins[1]
|
||||
local margin_y = margins[2]
|
||||
local margin_x = margins.x
|
||||
local margin_y = margins.y
|
||||
local mpoint = geom.make_point(acc.next_x + margin_x, y + margin_y)
|
||||
local r = arrange_panel_modules(common_, mods, mpoint, panel_mods.columns)
|
||||
local w = r.width + margin_x * 2
|
||||
|
@ -147,26 +148,27 @@ end
|
|||
return function(update_interval, config_path)
|
||||
local update_freq = 1 / update_interval
|
||||
local config = yaml.load(i_o.read_file(config_path))
|
||||
local cmods = config.modules
|
||||
|
||||
local main_state = {}
|
||||
|
||||
local mods = {
|
||||
memory = pure.partial(memory, update_freq, cmods.memory),
|
||||
readwrite = pure.partial(readwrite, update_freq, cmods.readwrite),
|
||||
local modlist = {
|
||||
memory = pure.partial(memory, update_freq),
|
||||
readwrite = pure.partial(readwrite, update_freq),
|
||||
network = pure.partial(network, update_freq),
|
||||
power = pure.partial(power, update_freq, cmods.power),
|
||||
filesystem = pure.partial(filesystem, cmods.filesystem, main_state),
|
||||
power = pure.partial(power, update_freq),
|
||||
filesystem = pure.partial(filesystem, main_state),
|
||||
system = pure.partial(system, main_state),
|
||||
graphics = pure.partial(graphics, update_freq, cmods.graphics),
|
||||
processor = pure.partial(processor, update_freq, cmods.processor, main_state),
|
||||
graphics = pure.partial(graphics, update_freq),
|
||||
processor = pure.partial(processor, update_freq, main_state),
|
||||
pacman = pure.partial(pacman, main_state)
|
||||
}
|
||||
|
||||
local anchor = config.layout.anchor
|
||||
|
||||
local compiled = compile_layout(
|
||||
common(config),
|
||||
geom.make_point(table.unpack(config.layout.anchor)),
|
||||
mods,
|
||||
geom.make_point(anchor.x, anchor.y),
|
||||
modlist,
|
||||
config.layout.panels
|
||||
)
|
||||
|
||||
|
|
|
@ -103,19 +103,23 @@ return function(config)
|
|||
-----------------------------------------------------------------------------
|
||||
-- timeseries helper functions
|
||||
|
||||
local _default_grid_config = timeseries.grid_config(
|
||||
geometry.plot.ticks[1],
|
||||
geometry.plot.ticks[2],
|
||||
local _default_grid_config = function(ticks_y)
|
||||
return timeseries.grid_config(
|
||||
geometry.plot.ticks_x,
|
||||
ticks_y,
|
||||
patterns.plot.grid
|
||||
)
|
||||
end
|
||||
|
||||
local _default_plot_config = timeseries.config(
|
||||
local _default_plot_config = function(ticks_y)
|
||||
return timeseries.config(
|
||||
geometry.plot.seconds,
|
||||
patterns.plot.outline,
|
||||
patterns.plot.data.border,
|
||||
patterns.plot.data.fill,
|
||||
_default_grid_config
|
||||
_default_grid_config(ticks_y)
|
||||
)
|
||||
end
|
||||
|
||||
local _format_percent_label = function(_)
|
||||
return function(z) return __string_format('%i%%', math.floor(z * 100)) end
|
||||
|
@ -131,18 +135,20 @@ return function(config)
|
|||
_format_percent_label
|
||||
)
|
||||
|
||||
local _make_timeseries = function(x, y, w, h, label_config, update_freq)
|
||||
local _make_timeseries = function(x, y, w, h, ticks_y, label_config, update_freq)
|
||||
return timeseries.make(
|
||||
geom.make_box(x, y, w, h),
|
||||
update_freq,
|
||||
_default_plot_config,
|
||||
_default_plot_config(ticks_y),
|
||||
label_config
|
||||
)
|
||||
end
|
||||
|
||||
local gplot = geometry.plot
|
||||
|
||||
local _make_tagged_percent_timeseries = function(x, y, w, h, spacing, label, update_freq, _format)
|
||||
local _make_tagged_percent_timeseries = function(x, y, w, h, ticks_y,
|
||||
spacing, label, update_freq,
|
||||
_format)
|
||||
return {
|
||||
label = _left_text(geom.make_point(x, y), label),
|
||||
value = text_threshold.make_formatted(
|
||||
|
@ -157,6 +163,7 @@ return function(config)
|
|||
y + _maybe_config(gplot.spacing, spacing),
|
||||
w,
|
||||
_maybe_config(gplot.height, h),
|
||||
ticks_y,
|
||||
update_freq
|
||||
),
|
||||
}
|
||||
|
@ -169,11 +176,11 @@ return function(config)
|
|||
return scaled_timeseries.scaling_parameters(2, m, 0.9)
|
||||
end
|
||||
|
||||
local _make_scaled_timeseries = function(x, y, w, h, f, min_domain, update_freq)
|
||||
local _make_scaled_timeseries = function(x, y, w, h, ticks_y, f, min_domain, update_freq)
|
||||
return scaled_timeseries.make(
|
||||
geom.make_box(x, y, w, h),
|
||||
update_freq,
|
||||
_default_plot_config,
|
||||
_default_plot_config(ticks_y),
|
||||
timeseries.label_config(patterns.text.inactive, label_font_spec, f),
|
||||
_base_2_scale_data(min_domain)
|
||||
)
|
||||
|
@ -216,22 +223,24 @@ return function(config)
|
|||
-----------------------------------------------------------------------------
|
||||
-- percent timeseries
|
||||
|
||||
M.make_percent_timeseries = function(x, y, w, h, update_freq)
|
||||
return _make_timeseries(x, y, w, h, _percent_label_config, update_freq)
|
||||
M.make_percent_timeseries = function(x, y, w, h, ticks_y, update_freq)
|
||||
return _make_timeseries(x, y, w, h, ticks_y, _percent_label_config, update_freq)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- tagged percent timeseries
|
||||
|
||||
M.make_tagged_percent_timeseries = function(x, y, w, h, spacing, label, update_freq)
|
||||
M.make_tagged_percent_timeseries = function(x, y, w, h, ticks_y, spacing,
|
||||
label, update_freq)
|
||||
return _make_tagged_percent_timeseries(
|
||||
x, y, w, h, spacing, label, update_freq, '%s%%'
|
||||
x, y, w, h, ticks_y, spacing, label, update_freq, '%s%%'
|
||||
)
|
||||
end
|
||||
|
||||
M.make_tagged_maybe_percent_timeseries = function(x, y, w, h, spacing, label, update_freq)
|
||||
M.make_tagged_maybe_percent_timeseries = function(x, y, w, h, ticks_y,
|
||||
spacing, label, update_freq)
|
||||
return _make_tagged_percent_timeseries(
|
||||
x, y, w, h, spacing, label, update_freq, _format_percent_maybe
|
||||
x, y, w, h, ticks_y, spacing, label, update_freq, _format_percent_maybe
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -294,9 +303,9 @@ return function(config)
|
|||
-----------------------------------------------------------------------------
|
||||
-- tagged scaled plot
|
||||
|
||||
M.make_tagged_scaled_timeseries = function(x, y, w, h, format_fun, label_fun,
|
||||
spacing, label, min_domain,
|
||||
update_freq)
|
||||
M.make_tagged_scaled_timeseries = function(x, y, w, h, ticks_y, format_fun,
|
||||
label_fun, spacing, label,
|
||||
min_domain, update_freq)
|
||||
return {
|
||||
label = _left_text(geom.make_point(x, y), label),
|
||||
value = text.make_formatted(
|
||||
|
@ -310,6 +319,7 @@ return function(config)
|
|||
y + spacing,
|
||||
w,
|
||||
h,
|
||||
ticks_y,
|
||||
label_fun,
|
||||
min_domain,
|
||||
update_freq
|
||||
|
@ -341,8 +351,9 @@ return function(config)
|
|||
end
|
||||
end
|
||||
|
||||
M.make_rate_timeseries = function(x, y, w, h, format_fun, label_fun, spacing,
|
||||
label, min_domain, update_freq, init)
|
||||
M.make_rate_timeseries = function(x, y, w, h, ticks_y, format_fun,
|
||||
label_fun, spacing, label, min_domain,
|
||||
update_freq, init)
|
||||
return {
|
||||
label = _left_text(geom.make_point(x, y), label),
|
||||
value = text.make_formatted(
|
||||
|
@ -356,6 +367,7 @@ return function(config)
|
|||
y + spacing,
|
||||
w,
|
||||
h,
|
||||
ticks_y,
|
||||
label_fun,
|
||||
min_domain,
|
||||
update_freq
|
||||
|
@ -615,8 +627,8 @@ return function(config)
|
|||
|
||||
local gtable = geometry.table
|
||||
local padding = gtable.padding
|
||||
local xpad = padding[1]
|
||||
local ypad = padding[2]
|
||||
local xpad = padding.x
|
||||
local ypad = padding.y
|
||||
|
||||
local default_table_font_spec = make_font_spec(font_family, font_sizes.table, false)
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@ local i_o = require 'i_o'
|
|||
local pure = require 'pure'
|
||||
local impure = require 'impure'
|
||||
|
||||
return function(config, main_state, common, width, point)
|
||||
local SPACING = 20
|
||||
local BAR_PAD = 100
|
||||
local SEPARATOR_SPACING = 20
|
||||
return function(main_state, config, common, width, point)
|
||||
local geo = config.geometry
|
||||
local bar_spacing = geo.bar_spacing
|
||||
local separator_bar_spacing = geo.sep_spacing
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- smartd
|
||||
|
@ -46,9 +46,11 @@ return function(config, main_state, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
BAR_PAD,
|
||||
-- TODO this isn't actually padding, it would be padding if it was
|
||||
-- relative to the right edge of the text column
|
||||
geo.bar_pad,
|
||||
names,
|
||||
SPACING,
|
||||
bar_spacing,
|
||||
12,
|
||||
80
|
||||
)
|
||||
|
@ -62,7 +64,7 @@ return function(config, main_state, common, width, point)
|
|||
end
|
||||
return common.mk_acc(
|
||||
width,
|
||||
(#config.fs_paths - 1) * SPACING,
|
||||
(#config.fs_paths - 1) * bar_spacing,
|
||||
update,
|
||||
pure.partial(common.compound_bar_draw_static, obj),
|
||||
pure.partial(common.compound_bar_draw_dynamic, obj)
|
||||
|
@ -77,7 +79,7 @@ return function(config, main_state, common, width, point)
|
|||
point = point,
|
||||
width = width,
|
||||
set_state = nil,
|
||||
top = {{mk_smart, config.show_smart, SEPARATOR_SPACING}},
|
||||
common.mk_section(SEPARATOR_SPACING, {mk_bars, true, 0})
|
||||
top = {{mk_smart, config.show_smart, separator_bar_spacing}},
|
||||
common.mk_section(separator_bar_spacing, {mk_bars, true, 0})
|
||||
}
|
||||
end
|
||||
|
|
|
@ -2,12 +2,15 @@ local pure = require 'pure'
|
|||
local i_o = require 'i_o'
|
||||
|
||||
return function(update_freq, config, common, width, point)
|
||||
local SEPARATOR_SPACING = 20
|
||||
local TEXT_SPACING = 20
|
||||
local PLOT_SEC_BREAK = 20
|
||||
local PLOT_HEIGHT = 56
|
||||
local NA = 'N/A'
|
||||
local NVIDIA_EXE = 'nvidia-settings'
|
||||
|
||||
local geo = config.geometry
|
||||
local sep_spacing = geo.sep_spacing
|
||||
local text_spacing = geo.text_spacing
|
||||
local plot_sec_break = geo.plot.sec_break
|
||||
local plot_height = geo.plot.height
|
||||
|
||||
local __string_match = string.match
|
||||
local __string_format = string.format
|
||||
local __tonumber = tonumber
|
||||
|
@ -88,8 +91,9 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
PLOT_SEC_BREAK,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
plot_sec_break,
|
||||
label,
|
||||
update_freq
|
||||
)
|
||||
|
@ -102,7 +106,7 @@ return function(update_freq, config, common, width, point)
|
|||
local dynamic = pure.partial(common.tagged_percent_timeseries_draw_dynamic, obj)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
update,
|
||||
static,
|
||||
dynamic
|
||||
|
@ -154,7 +158,7 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
TEXT_SPACING,
|
||||
text_spacing,
|
||||
{'GPU Clock Speed', 'Memory Clock Speed'}
|
||||
)
|
||||
local update = function()
|
||||
|
@ -168,7 +172,7 @@ return function(update_freq, config, common, width, point)
|
|||
end
|
||||
local static = pure.partial(common.text_rows_draw_static, obj)
|
||||
local dynamic = pure.partial(common.text_rows_draw_dynamic, obj)
|
||||
return common.mk_acc(width, TEXT_SPACING, update, static, dynamic)
|
||||
return common.mk_acc(width, text_spacing, update, static, dynamic)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
@ -206,19 +210,19 @@ return function(update_freq, config, common, width, point)
|
|||
point = point,
|
||||
width = width,
|
||||
set_state = update_state,
|
||||
top = {{mk_status, true, SEPARATOR_SPACING}},
|
||||
top = {{mk_status, true, sep_spacing}},
|
||||
common.mk_section(
|
||||
SEPARATOR_SPACING,
|
||||
{mk_temp, config.show_temp, SEPARATOR_SPACING}
|
||||
sep_spacing,
|
||||
{mk_temp, config.show_temp, sep_spacing}
|
||||
),
|
||||
common.mk_section(
|
||||
SEPARATOR_SPACING,
|
||||
{mk_clock, config.show_clock, SEPARATOR_SPACING}
|
||||
sep_spacing,
|
||||
{mk_clock, config.show_clock, sep_spacing}
|
||||
),
|
||||
common.mk_section(
|
||||
SEPARATOR_SPACING,
|
||||
{mk_gpu_util, config.show_gpu_util, PLOT_SEC_BREAK},
|
||||
{mk_mem_util, config.show_mem_util, PLOT_SEC_BREAK},
|
||||
sep_spacing,
|
||||
{mk_gpu_util, config.show_gpu_util, plot_sec_break},
|
||||
{mk_mem_util, config.show_mem_util, plot_sec_break},
|
||||
{mk_vid_util, config.show_vid_util, 0}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -5,15 +5,16 @@ local pure = require 'pure'
|
|||
local sys = require 'sys'
|
||||
|
||||
return function(update_freq, config, common, width, point)
|
||||
local DIAL_THICKNESS = 8
|
||||
local DIAL_RADIUS = 32
|
||||
local DIAL_SPACING = 40
|
||||
local CACHE_Y_OFFSET = 7
|
||||
local CACHE_X_OFFSET = 50
|
||||
local TEXT_SPACING = 20
|
||||
local PLOT_SECTION_BREAK = 23
|
||||
local PLOT_HEIGHT = 56
|
||||
local TABLE_SECTION_BREAK = 20
|
||||
local dial_thickness = 8
|
||||
local dial_radius = 32
|
||||
local dial_x_spacing = 40
|
||||
local cache_y_offset = 7
|
||||
local cache_x_offset = 50
|
||||
|
||||
local geo = config.geometry
|
||||
local plot_sec_break = geo.plot.sec_break
|
||||
local plot_height = geo.plot.height
|
||||
local table_sec_break = geo.table.sec_break
|
||||
|
||||
local __math_floor = math.floor
|
||||
local __string_format = string.format
|
||||
|
@ -49,34 +50,34 @@ return function(update_freq, config, common, width, point)
|
|||
-- mem stats (dial + text)
|
||||
|
||||
local mk_stats = function(y)
|
||||
local MEM_X = point.x + DIAL_RADIUS + DIAL_THICKNESS / 2
|
||||
local DIAL_DIAMETER = DIAL_RADIUS * 2 + DIAL_THICKNESS
|
||||
local CACHE_X
|
||||
local SWAP_X
|
||||
local mem_x = point.x + dial_radius + dial_thickness / 2
|
||||
local dial_diameter = dial_radius * 2 + dial_thickness
|
||||
local cache_x
|
||||
local swap_x
|
||||
if _show_swap == true then
|
||||
SWAP_X = MEM_X + DIAL_DIAMETER + DIAL_SPACING
|
||||
CACHE_X = SWAP_X + CACHE_X_OFFSET + DIAL_DIAMETER / 2
|
||||
swap_x = mem_x + dial_diameter + dial_x_spacing
|
||||
cache_x = swap_x + cache_x_offset + dial_diameter / 2
|
||||
else
|
||||
CACHE_X = MEM_X + CACHE_X_OFFSET + DIAL_DIAMETER / 2
|
||||
cache_x = mem_x + cache_x_offset + dial_diameter / 2
|
||||
end
|
||||
local CACHE_WIDTH = point.x + width - CACHE_X
|
||||
local cache_width = point.x + width - cache_x
|
||||
local format_percent = pure.partial(__string_format, '%i%%', true)
|
||||
|
||||
-- memory bits (used no matter what)
|
||||
local mem = common.make_dial(
|
||||
MEM_X,
|
||||
y + DIAL_RADIUS,
|
||||
DIAL_RADIUS,
|
||||
DIAL_THICKNESS,
|
||||
mem_x,
|
||||
y + dial_radius,
|
||||
dial_radius,
|
||||
dial_thickness,
|
||||
80,
|
||||
format_percent,
|
||||
__math_floor
|
||||
)
|
||||
local cache = common.make_text_rows_formatted(
|
||||
CACHE_X,
|
||||
y + CACHE_Y_OFFSET,
|
||||
CACHE_WIDTH,
|
||||
TEXT_SPACING,
|
||||
cache_x,
|
||||
y + cache_y_offset,
|
||||
cache_width,
|
||||
geo.text_spacing,
|
||||
{'Page Cache', 'Buffers', 'Shared', 'Kernel Slab'},
|
||||
'%.1f%%'
|
||||
)
|
||||
|
@ -98,15 +99,15 @@ return function(update_freq, config, common, width, point)
|
|||
common.dial_draw_dynamic(mem, cr)
|
||||
common.text_rows_draw_dynamic(cache, cr)
|
||||
end
|
||||
local ret = pure.partial(common.mk_acc, width, DIAL_DIAMETER)
|
||||
local ret = pure.partial(common.mk_acc, width, dial_diameter)
|
||||
|
||||
-- add swap bits if needed
|
||||
if _show_swap == true then
|
||||
local swap = common.make_dial(
|
||||
SWAP_X,
|
||||
y + DIAL_RADIUS,
|
||||
DIAL_RADIUS,
|
||||
DIAL_THICKNESS,
|
||||
swap_x,
|
||||
y + dial_radius,
|
||||
dial_radius,
|
||||
dial_thickness,
|
||||
80,
|
||||
format_percent,
|
||||
__math_floor
|
||||
|
@ -135,12 +136,13 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
update_freq
|
||||
)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
plot_height,
|
||||
function() timeseries.update(obj, mod_state.mem.used_percent) end,
|
||||
pure.partial(timeseries.draw_static, obj),
|
||||
pure.partial(timeseries.draw_dynamic, obj)
|
||||
|
@ -152,14 +154,15 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
PLOT_SECTION_BREAK,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
plot_sec_break,
|
||||
"Total Memory",
|
||||
update_freq
|
||||
)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SECTION_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
function()
|
||||
common.tagged_percent_timeseries_set(
|
||||
obj,
|
||||
|
@ -216,8 +219,8 @@ return function(update_freq, config, common, width, point)
|
|||
width = width,
|
||||
set_state = read_state,
|
||||
top = {
|
||||
{mk_stats, config.show_stats, PLOT_SECTION_BREAK},
|
||||
{mk_plot, config.show_plot, TABLE_SECTION_BREAK},
|
||||
{mk_stats, config.show_stats, plot_sec_break},
|
||||
{mk_plot, config.show_plot, table_sec_break},
|
||||
{mk_tbl, config.table_rows > 0, 0},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,10 @@ local pure = require 'pure'
|
|||
local i_o = require 'i_o'
|
||||
local sys = require 'sys'
|
||||
|
||||
return function(update_freq, common, width, point)
|
||||
local PLOT_SEC_BREAK = 20
|
||||
local PLOT_HEIGHT = 56
|
||||
return function(update_freq, config, common, width, point)
|
||||
local geo = config.geometry
|
||||
local plot_sec_break = geo.plot.sec_break
|
||||
local plot_height = geo.plot.height
|
||||
local interface_paths = sys.get_net_interface_paths()
|
||||
|
||||
local get_bits = function(path)
|
||||
|
@ -40,10 +41,11 @@ return function(update_freq, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
value_format_function,
|
||||
common.converted_y_label_format_generator('b'),
|
||||
PLOT_SEC_BREAK,
|
||||
plot_sec_break,
|
||||
label,
|
||||
2,
|
||||
update_freq,
|
||||
|
@ -51,7 +53,7 @@ return function(update_freq, common, width, point)
|
|||
)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
function() common.update_rate_timeseries(obj, mod_state[key]) end,
|
||||
pure.partial(common.tagged_scaled_timeseries_draw_static, obj),
|
||||
pure.partial(common.tagged_scaled_timeseries_draw_dynamic, obj)
|
||||
|
@ -70,7 +72,7 @@ return function(update_freq, common, width, point)
|
|||
width = width,
|
||||
set_state = read_interfaces,
|
||||
top = {
|
||||
{mk_rx, true, PLOT_SEC_BREAK},
|
||||
{mk_rx, true, plot_sec_break},
|
||||
{mk_tx, true, 0},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local pure = require 'pure'
|
||||
|
||||
return function(main_state, common, width, point)
|
||||
local TEXT_SPACING = 20
|
||||
return function(main_state, config, common, width, point)
|
||||
local text_spacing = config.geometry.text_spacing
|
||||
|
||||
local __string_match = string.match
|
||||
local __string_gmatch = string.gmatch
|
||||
|
@ -11,7 +11,7 @@ return function(main_state, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
TEXT_SPACING,
|
||||
text_spacing,
|
||||
{'Total', 'Explicit', 'Outdated', 'Orphaned', 'Local'}
|
||||
)
|
||||
local update = function()
|
||||
|
@ -33,7 +33,7 @@ return function(main_state, common, width, point)
|
|||
end
|
||||
return common.mk_acc(
|
||||
width,
|
||||
TEXT_SPACING * 4,
|
||||
text_spacing * 4,
|
||||
update,
|
||||
pure.partial(common.text_rows_draw_static, obj),
|
||||
pure.partial(common.text_rows_draw_dynamic, obj)
|
||||
|
|
|
@ -3,9 +3,9 @@ local pure = require 'pure'
|
|||
local sys = require 'sys'
|
||||
|
||||
return function(update_freq, config, common, width, point)
|
||||
local TEXT_SPACING = 20
|
||||
local PLOT_SEC_BREAK = 20
|
||||
local PLOT_HEIGHT = 56
|
||||
local geo = config.geometry
|
||||
local plot_sec_break = geo.plot.sec_break
|
||||
local plot_height = geo.plot.height
|
||||
|
||||
local power_label_function = function(plot_max)
|
||||
local fmt = common.y_label_format_string(plot_max, 'W')
|
||||
|
@ -30,10 +30,11 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
format_rapl,
|
||||
power_label_function,
|
||||
PLOT_SEC_BREAK,
|
||||
plot_sec_break,
|
||||
label,
|
||||
0,
|
||||
update_freq,
|
||||
|
@ -41,7 +42,7 @@ return function(update_freq, config, common, width, point)
|
|||
)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
function(_) common.update_rate_timeseries(obj, read_joules()) end,
|
||||
mk_static(obj),
|
||||
mk_dynamic(obj)
|
||||
|
@ -50,7 +51,7 @@ return function(update_freq, config, common, width, point)
|
|||
|
||||
local mk_rate_blockspec = function(spec)
|
||||
local f = pure.partial(mk_rate_plot, spec.name, spec.address)
|
||||
return {f, true, TEXT_SPACING}
|
||||
return {f, true, geo.text_spacing}
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
@ -72,17 +73,18 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
format_ac,
|
||||
power_label_function,
|
||||
PLOT_SEC_BREAK,
|
||||
plot_sec_break,
|
||||
'Battery Draw',
|
||||
0,
|
||||
update_freq
|
||||
)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
function()
|
||||
common.tagged_scaled_timeseries_set(
|
||||
obj,
|
||||
|
|
|
@ -6,16 +6,17 @@ local pure = require 'pure'
|
|||
|
||||
local __math_floor = math.floor
|
||||
|
||||
return function(update_freq, config, main_state, common, width, point)
|
||||
local DIAL_INNER_RADIUS = 30
|
||||
local DIAL_OUTER_RADIUS = 42
|
||||
local DIAL_THICKNESS = 5.5
|
||||
local DIAL_SPACING = 20
|
||||
local SEPARATOR_SPACING = 20
|
||||
local TEXT_SPACING = 22
|
||||
local PLOT_SECTION_BREAK = 23
|
||||
local PLOT_HEIGHT = 56
|
||||
local TABLE_SECTION_BREAK = 20
|
||||
return function(update_freq, main_state, config, common, width, point)
|
||||
local dial_inner_radius = 30
|
||||
local dial_outer_radius = 42
|
||||
local dial_thickness = 5.5
|
||||
local dial_y_spacing = 20
|
||||
|
||||
local geo = config.geometry
|
||||
local sep_spacing = geo.sep_spacing
|
||||
local text_spacing = geo.text_spacing
|
||||
local plot_sec_break = geo.plot.sec_break
|
||||
local plot_height = geo.plot.height
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- processor state
|
||||
|
@ -51,26 +52,26 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
local dial_x = point.x +
|
||||
(core_cols == 1
|
||||
and (width / 2)
|
||||
or (config.core_padding + DIAL_OUTER_RADIUS +
|
||||
(width - 2 * (DIAL_OUTER_RADIUS + config.core_padding))
|
||||
or (config.core_padding + dial_outer_radius +
|
||||
(width - 2 * (dial_outer_radius + config.core_padding))
|
||||
* math.fmod(c - 1, core_cols) / (core_cols - 1)))
|
||||
local dial_y = y + DIAL_OUTER_RADIUS +
|
||||
(2 * DIAL_OUTER_RADIUS + DIAL_SPACING)
|
||||
local dial_y = y + dial_outer_radius +
|
||||
(2 * dial_outer_radius + dial_y_spacing)
|
||||
* math.floor((c - 1) / core_cols)
|
||||
return {
|
||||
loads = common.make_compound_dial(
|
||||
dial_x,
|
||||
dial_y,
|
||||
DIAL_OUTER_RADIUS,
|
||||
DIAL_INNER_RADIUS,
|
||||
DIAL_THICKNESS,
|
||||
dial_outer_radius,
|
||||
dial_inner_radius,
|
||||
dial_thickness,
|
||||
80,
|
||||
nthreads
|
||||
),
|
||||
coretemp = common.make_text_circle(
|
||||
dial_x,
|
||||
dial_y,
|
||||
DIAL_INNER_RADIUS - 2,
|
||||
dial_inner_radius - 2,
|
||||
'%s°C',
|
||||
80,
|
||||
__math_floor
|
||||
|
@ -115,8 +116,8 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
end
|
||||
return common.mk_acc(
|
||||
width,
|
||||
(DIAL_OUTER_RADIUS * 2 + DIAL_SPACING) * config.core_rows
|
||||
- DIAL_SPACING,
|
||||
(dial_outer_radius * 2 + dial_y_spacing) * config.core_rows
|
||||
- dial_y_spacing,
|
||||
update,
|
||||
static,
|
||||
dynamic
|
||||
|
@ -132,7 +133,7 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
TEXT_SPACING,
|
||||
text_spacing,
|
||||
{'HWP Preference', 'Ave Freq'}
|
||||
)
|
||||
local update = function()
|
||||
|
@ -148,7 +149,7 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
local dynamic = pure.partial(common.text_rows_draw_dynamic, cpu_status)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
TEXT_SPACING,
|
||||
text_spacing,
|
||||
update,
|
||||
static,
|
||||
dynamic
|
||||
|
@ -163,8 +164,9 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
PLOT_SECTION_BREAK,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
plot_sec_break,
|
||||
"Total Load",
|
||||
update_freq
|
||||
)
|
||||
|
@ -177,7 +179,7 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
end
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SECTION_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
update,
|
||||
pure.partial(common.tagged_percent_timeseries_draw_static, total_load),
|
||||
pure.partial(common.tagged_percent_timeseries_draw_dynamic, total_load)
|
||||
|
@ -229,12 +231,12 @@ return function(update_freq, config, main_state, common, width, point)
|
|||
width = width,
|
||||
set_state = update_state,
|
||||
top = {
|
||||
{mk_cores, show_cores, TEXT_SPACING},
|
||||
{mk_hwp_freq, config.show_stats, SEPARATOR_SPACING},
|
||||
{mk_cores, show_cores, text_spacing},
|
||||
{mk_hwp_freq, config.show_stats, sep_spacing},
|
||||
},
|
||||
common.mk_section(
|
||||
SEPARATOR_SPACING,
|
||||
{mk_load_plot, config.show_plot, TABLE_SECTION_BREAK},
|
||||
sep_spacing,
|
||||
{mk_load_plot, config.show_plot, geo.table.sec_break},
|
||||
{mk_tbl, config.table_rows > 0, 0}
|
||||
)
|
||||
}
|
||||
|
|
|
@ -5,8 +5,9 @@ local i_o = require 'i_o'
|
|||
local impure = require 'impure'
|
||||
|
||||
return function(update_freq, config, common, width, point)
|
||||
local PLOT_SEC_BREAK = 20
|
||||
local PLOT_HEIGHT = 56
|
||||
local geo = config.geometry
|
||||
local plot_sec_break = geo.plot.sec_break
|
||||
local plot_height = geo.plot.height
|
||||
|
||||
local mod_state = {read = 0, write = 0}
|
||||
local device_paths = sys.get_disk_paths(config.devices)
|
||||
|
@ -33,10 +34,11 @@ return function(update_freq, config, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
PLOT_HEIGHT,
|
||||
plot_height,
|
||||
geo.plot.ticks_y,
|
||||
format_value_function,
|
||||
common.converted_y_label_format_generator('B'),
|
||||
PLOT_SEC_BREAK,
|
||||
plot_sec_break,
|
||||
label,
|
||||
2,
|
||||
update_freq,
|
||||
|
@ -44,7 +46,7 @@ return function(update_freq, config, common, width, point)
|
|||
)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
PLOT_HEIGHT + PLOT_SEC_BREAK,
|
||||
plot_height + plot_sec_break,
|
||||
function() common.update_rate_timeseries(obj, mod_state[key]) end,
|
||||
pure.partial(common.tagged_scaled_timeseries_draw_static, obj),
|
||||
pure.partial(common.tagged_scaled_timeseries_draw_dynamic, obj)
|
||||
|
@ -63,7 +65,7 @@ return function(update_freq, config, common, width, point)
|
|||
width = width,
|
||||
set_state = update_state,
|
||||
top = {
|
||||
{mk_reads, true, PLOT_SEC_BREAK},
|
||||
{mk_reads, true, plot_sec_break},
|
||||
{mk_writes, true, 0},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
local i_o = require 'i_o'
|
||||
local pure = require 'pure'
|
||||
|
||||
return function(main_state, common, width, point)
|
||||
local TEXT_SPACING = 20
|
||||
return function(main_state, config, common, width, point)
|
||||
local text_spacing = config.geometry.text_spacing
|
||||
|
||||
local __string_match = string.match
|
||||
|
||||
|
@ -11,7 +11,7 @@ return function(main_state, common, width, point)
|
|||
point.x,
|
||||
y,
|
||||
width,
|
||||
TEXT_SPACING,
|
||||
text_spacing,
|
||||
{'Kernel', 'Uptime', 'Last Upgrade', 'Last Sync'}
|
||||
)
|
||||
-- just update this once
|
||||
|
@ -35,7 +35,7 @@ return function(main_state, common, width, point)
|
|||
local dynamic = pure.partial(common.text_rows_draw_dynamic, obj)
|
||||
return common.mk_acc(
|
||||
width,
|
||||
TEXT_SPACING * 3,
|
||||
text_spacing * 3,
|
||||
update,
|
||||
static,
|
||||
dynamic
|
||||
|
|
Loading…
Reference in New Issue