remove old interface switch

This commit is contained in:
petrucci4prez 2018-08-05 11:08:37 -04:00
parent 7dde7151a3
commit 77974cc7bc
10 changed files with 145 additions and 163 deletions

View File

@ -59,15 +59,13 @@ local update = function(cr)
end
end
local draw = function(cr, current_interface, trigger)
if trigger == 0 then update(cr) end
local draw = function(cr, trigger)
if trigger == 0 then update(cr) end
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
CompoundBar.draw(bars, cr)
end
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
CompoundBar.draw(bars, cr)
end
return draw

View File

@ -266,40 +266,38 @@ _GPU_UTIL_Y_ = nil
_MEM_UTIL_Y_ = nil
_VID_UTIL_Y_ = nil
local draw = function(cr, current_interface)
update(cr)
local draw = function(cr)
update(cr)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(status.label, cr)
Text.draw(status.value, cr)
Text.draw(status.label, cr)
Text.draw(status.value, cr)
Line.draw(separator1, cr)
Line.draw(separator1, cr)
Text.draw(internal_temp.label, cr)
Text.draw(internal_temp.value, cr)
Text.draw(internal_temp.label, cr)
Text.draw(internal_temp.value, cr)
Line.draw(separator2, cr)
Line.draw(separator2, cr)
TextColumn.draw(clock_speed.labels, cr)
TextColumn.draw(clock_speed.values, cr)
TextColumn.draw(clock_speed.labels, cr)
TextColumn.draw(clock_speed.values, cr)
Line.draw(separator3, cr)
Line.draw(separator3, cr)
Text.draw(gpu_util.label, cr)
Text.draw(gpu_util.value, cr)
LabelPlot.draw(gpu_util.plot, cr)
Text.draw(gpu_util.label, cr)
Text.draw(gpu_util.value, cr)
LabelPlot.draw(gpu_util.plot, cr)
Text.draw(mem_util.label, cr)
Text.draw(mem_util.value, cr)
LabelPlot.draw(mem_util.plot, cr)
Text.draw(mem_util.label, cr)
Text.draw(mem_util.value, cr)
LabelPlot.draw(mem_util.plot, cr)
Text.draw(vid_util.label, cr)
Text.draw(vid_util.value, cr)
LabelPlot.draw(vid_util.plot, cr)
end
Text.draw(vid_util.label, cr)
Text.draw(vid_util.value, cr)
LabelPlot.draw(vid_util.plot, cr)
end
return draw

View File

@ -196,26 +196,24 @@ _TEXT_LEFT_X_ = nil
_RIGHT_X_ = nil
_PLOT_Y_ = nil
local draw = function(cr, current_interface)
update(cr)
local draw = function(cr)
update(cr)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Dial.draw(dial, cr)
Arc.draw(cache_arc, cr)
Arc.draw(inner_ring, cr)
CriticalText.draw(total_used, cr)
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Dial.draw(dial, cr)
Arc.draw(cache_arc, cr)
Arc.draw(inner_ring, cr)
CriticalText.draw(total_used, cr)
Text.draw(swap.label, cr)
CriticalText.draw(swap.percent, cr)
TextColumn.draw(cache.labels, cr)
TextColumn.draw(cache.percents, cr)
Text.draw(swap.label, cr)
CriticalText.draw(swap.percent, cr)
TextColumn.draw(cache.labels, cr)
TextColumn.draw(cache.percents, cr)
LabelPlot.draw(plot, cr)
LabelPlot.draw(plot, cr)
Table.draw(tbl, cr)
end
Table.draw(tbl, cr)
end
return draw

View File

@ -130,21 +130,19 @@ _PLOT_HEIGHT_ = nil
_RIGHT_X_ = nil
_UPLOAD_Y_ = nil
local draw = function(cr, current_interface, update_frequency)
update(cr, update_frequency)
local draw = function(cr, update_frequency)
update(cr, update_frequency)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(dnload.label, cr)
Text.draw(dnload.speed, cr)
ScalePlot.draw(dnload.plot, cr)
Text.draw(dnload.label, cr)
Text.draw(dnload.speed, cr)
ScalePlot.draw(dnload.plot, cr)
Text.draw(upload.label, cr)
Text.draw(upload.speed, cr)
ScalePlot.draw(upload.plot, cr)
end
Text.draw(upload.label, cr)
Text.draw(upload.speed, cr)
ScalePlot.draw(upload.plot, cr)
end
return draw

View File

@ -47,15 +47,13 @@ local update = function(cr)
end
end
local draw = function(cr, current_interface, log_is_changed)
if log_is_changed then update(cr) end
local draw = function(cr, log_is_changed)
if log_is_changed then update(cr) end
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
TextColumn.draw(info, cr)
end
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
TextColumn.draw(info, cr)
end
return draw

View File

@ -209,27 +209,25 @@ _RIGHT_X_ = nil
_CORE_Y_ = nil
_BATTERY_DRAW_Y_ = nil
local draw = function(cr, current_interface, update_frequency, is_using_ac)
update(cr, update_frequency, is_using_ac)
local draw = function(cr, update_frequency, is_using_ac)
update(cr, update_frequency, is_using_ac)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(pkg0.labels, cr)
Text.draw(pkg0.llcmc_value, cr)
Text.draw(pkg0.core_value, cr)
Text.draw(pkg0.igpu_value, cr)
ScalePlot.draw(pkg0.plot, cr)
TextColumn.draw(pkg0.labels, cr)
Text.draw(pkg0.llcmc_value, cr)
Text.draw(pkg0.core_value, cr)
Text.draw(pkg0.igpu_value, cr)
ScalePlot.draw(pkg0.plot, cr)
Text.draw(dram.label, cr)
Text.draw(dram.value, cr)
ScalePlot.draw(dram.plot, cr)
Text.draw(dram.label, cr)
Text.draw(dram.value, cr)
ScalePlot.draw(dram.plot, cr)
Text.draw(battery_draw.label, cr)
Text.draw(battery_draw.value, cr)
ScalePlot.draw(battery_draw.plot, cr)
end
Text.draw(battery_draw.label, cr)
Text.draw(battery_draw.value, cr)
ScalePlot.draw(battery_draw.plot, cr)
end
return draw

View File

@ -249,35 +249,33 @@ _SEP_Y_ = nil
_PROCESS_Y_ = nil
_PLOT_Y_ = nil
local draw = function(cr, current_interface)
local draw = function(cr)
update(cr)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
for c = 1, NUM_PHYSICAL_CORES do
local core = cores[c]
CompoundDial.draw(core.dials, cr)
Arc.draw(core.inner_ring, cr)
CriticalText.draw(core.coretemp_text, cr)
end
Text.draw(process.label, cr)
Text.draw(process.value, cr)
Text.draw(ave_freq.label, cr)
Text.draw(ave_freq.value, cr)
Line.draw(separator, cr)
Text.draw(total_load.label, cr)
CriticalText.draw(total_load.value, cr)
LabelPlot.draw(plot, cr)
Table.draw(tbl, cr)
for c = 1, NUM_PHYSICAL_CORES do
local core = cores[c]
CompoundDial.draw(core.dials, cr)
Arc.draw(core.inner_ring, cr)
CriticalText.draw(core.coretemp_text, cr)
end
Text.draw(process.label, cr)
Text.draw(process.value, cr)
Text.draw(ave_freq.label, cr)
Text.draw(ave_freq.value, cr)
Line.draw(separator, cr)
Text.draw(total_load.label, cr)
CriticalText.draw(total_load.value, cr)
LabelPlot.draw(plot, cr)
Table.draw(tbl, cr)
end
return draw

View File

@ -117,21 +117,19 @@ local update = function(cr, update_frequency)
update_stat(cr, writes, write_byte_cnt, update_frequency)
end
local draw = function(cr, current_interface, update_frequency)
update(cr, update_frequency)
local draw = function(cr, update_frequency)
update(cr, update_frequency)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
Text.draw(reads.label, cr)
Text.draw(reads.rate, cr)
ScalePlot.draw(reads.plot, cr)
Text.draw(reads.label, cr)
Text.draw(reads.rate, cr)
ScalePlot.draw(reads.plot, cr)
Text.draw(writes.label, cr)
Text.draw(writes.rate, cr)
ScalePlot.draw(writes.plot, cr)
end
Text.draw(writes.label, cr)
Text.draw(writes.rate, cr)
ScalePlot.draw(writes.plot, cr)
end
return draw

View File

@ -42,22 +42,20 @@ local info = _G_Widget_.TextColumn{
_TEXT_SPACING_ = nil
local draw = function(cr, current_interface, log_is_changed)
TextColumn.set(info, cr, 2, Util.conky('$uptime'))
local draw = function(cr, log_is_changed)
TextColumn.set(info, cr, 2, Util.conky('$uptime'))
if log_is_changed then
TextColumn.set(info, cr, 3, extract_date("sed -n "..
"'/ starting full system upgrade/p' /var/log/pacman.log | tail -1"))
TextColumn.set(info, cr, 4, extract_date("sed -n "..
"'/ synchronizing package lists/p' /var/log/pacman.log | tail -1"))
end
if log_is_changed then
TextColumn.set(info, cr, 3, extract_date("sed -n "..
"'/ starting full system upgrade/p' /var/log/pacman.log | tail -1"))
TextColumn.set(info, cr, 4, extract_date("sed -n "..
"'/ synchronizing package lists/p' /var/log/pacman.log | tail -1"))
end
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
TextColumn.draw(info, cr)
end
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
TextColumn.draw(info, cr)
end
return draw

View File

@ -132,6 +132,8 @@ _G_INIT_DATA_ = nil
local updates = -2
local __cairo_xlib_surface_create = cairo_xlib_surface_create
local __cairo_set_source_surface = cairo_set_source_surface
local __cairo_paint = cairo_paint
local __cairo_create = cairo_create
local __cairo_surface_destroy = cairo_surface_destroy
local __cairo_destroy = cairo_destroy
@ -150,10 +152,6 @@ local check_if_log_changed = function()
return 0
end
-- kept for historic reasons, if we choose to make another panel then this
-- will be useful
local current_interface = 0
local cs_p
local uninit = 1
@ -166,8 +164,10 @@ end
function conky_main()
if uninit then return end
local _cw = conky_window
if not _cw then return end
local cs = __cairo_xlib_surface_create(_cw.display, _cw.drawable, _cw.visual, 1920, 1080)
local cr = __cairo_create(cs)
@ -191,17 +191,17 @@ function conky_main()
-- local pt1 = os.clock()
System(cr, current_interface, log_is_changed)
Graphics(cr, current_interface)
Processor(cr, current_interface)
System(cr, log_is_changed)
Graphics(cr)
Processor(cr)
ReadWrite(cr, current_interface, UPDATE_FREQUENCY)
Network(cr, current_interface, UPDATE_FREQUENCY)
ReadWrite(cr, UPDATE_FREQUENCY)
Network(cr, UPDATE_FREQUENCY)
Pacman(cr, current_interface, log_is_changed)
FileSystem(cr, current_interface, t1)
Power(cr, current_interface, UPDATE_FREQUENCY, is_using_ac)
Memory(cr, current_interface)
Pacman(cr, log_is_changed)
FileSystem(cr, t1)
Power(cr, UPDATE_FREQUENCY, is_using_ac)
Memory(cr)
-- local pt2 = os.clock() - pt1
-- print(pt2)