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
end end
local draw = function(cr, current_interface, trigger) local draw = function(cr, trigger)
if trigger == 0 then update(cr) end if trigger == 0 then update(cr) end
if current_interface == 0 then 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) CompoundBar.draw(bars, cr)
CompoundBar.draw(bars, cr)
end
end end
return draw return draw

View File

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

View File

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

View File

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

View File

@ -47,15 +47,13 @@ local update = function(cr)
end end
end end
local draw = function(cr, current_interface, log_is_changed) local draw = function(cr, log_is_changed)
if log_is_changed then update(cr) end if log_is_changed then update(cr) end
if current_interface == 0 then 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) TextColumn.draw(info, cr)
TextColumn.draw(info, cr)
end
end end
return draw return draw

View File

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

View File

@ -249,35 +249,33 @@ _SEP_Y_ = nil
_PROCESS_Y_ = nil _PROCESS_Y_ = nil
_PLOT_Y_ = nil _PLOT_Y_ = nil
local draw = function(cr, current_interface) local draw = function(cr)
update(cr) update(cr)
if current_interface == 0 then Text.draw(header.text, cr)
Text.draw(header.text, cr) Line.draw(header.underline, cr)
Line.draw(header.underline, cr)
for c = 1, NUM_PHYSICAL_CORES do for c = 1, NUM_PHYSICAL_CORES do
local core = cores[c] local core = cores[c]
CompoundDial.draw(core.dials, cr) CompoundDial.draw(core.dials, cr)
Arc.draw(core.inner_ring, cr) Arc.draw(core.inner_ring, cr)
CriticalText.draw(core.coretemp_text, 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 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 end
return draw return draw

View File

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

View File

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

View File

@ -132,6 +132,8 @@ _G_INIT_DATA_ = nil
local updates = -2 local updates = -2
local __cairo_xlib_surface_create = cairo_xlib_surface_create 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_create = cairo_create
local __cairo_surface_destroy = cairo_surface_destroy local __cairo_surface_destroy = cairo_surface_destroy
local __cairo_destroy = cairo_destroy local __cairo_destroy = cairo_destroy
@ -150,10 +152,6 @@ local check_if_log_changed = function()
return 0 return 0
end 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 cs_p
local uninit = 1 local uninit = 1
@ -166,8 +164,10 @@ end
function conky_main() function conky_main()
if uninit then return end if uninit then return end
local _cw = conky_window local _cw = conky_window
if not _cw then return end if not _cw then return end
local cs = __cairo_xlib_surface_create(_cw.display, _cw.drawable, _cw.visual, 1920, 1080) local cs = __cairo_xlib_surface_create(_cw.display, _cw.drawable, _cw.visual, 1920, 1080)
local cr = __cairo_create(cs) local cr = __cairo_create(cs)
@ -191,17 +191,17 @@ function conky_main()
-- local pt1 = os.clock() -- local pt1 = os.clock()
System(cr, current_interface, log_is_changed) System(cr, log_is_changed)
Graphics(cr, current_interface) Graphics(cr)
Processor(cr, current_interface) Processor(cr)
ReadWrite(cr, current_interface, UPDATE_FREQUENCY) ReadWrite(cr, UPDATE_FREQUENCY)
Network(cr, current_interface, UPDATE_FREQUENCY) Network(cr, UPDATE_FREQUENCY)
Pacman(cr, current_interface, log_is_changed) Pacman(cr, log_is_changed)
FileSystem(cr, current_interface, t1) FileSystem(cr, t1)
Power(cr, current_interface, UPDATE_FREQUENCY, is_using_ac) Power(cr, UPDATE_FREQUENCY, is_using_ac)
Memory(cr, current_interface) Memory(cr)
-- local pt2 = os.clock() - pt1 -- local pt2 = os.clock() - pt1
-- print(pt2) -- print(pt2)