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)
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
end
return draw

View File

@ -266,10 +266,9 @@ _GPU_UTIL_Y_ = nil
_MEM_UTIL_Y_ = nil
_VID_UTIL_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)
@ -299,7 +298,6 @@ local draw = function(cr, current_interface)
Text.draw(vid_util.label, cr)
Text.draw(vid_util.value, cr)
LabelPlot.draw(vid_util.plot, cr)
end
end
return draw

View File

@ -196,10 +196,9 @@ _TEXT_LEFT_X_ = nil
_RIGHT_X_ = 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)
Dial.draw(dial, cr)
@ -215,7 +214,6 @@ local draw = function(cr, current_interface)
LabelPlot.draw(plot, cr)
Table.draw(tbl, cr)
end
end
return draw

View File

@ -130,10 +130,9 @@ _PLOT_HEIGHT_ = nil
_RIGHT_X_ = nil
_UPLOAD_Y_ = nil
local draw = function(cr, current_interface, 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)
@ -144,7 +143,6 @@ local draw = function(cr, current_interface, update_frequency)
Text.draw(upload.label, cr)
Text.draw(upload.speed, cr)
ScalePlot.draw(upload.plot, cr)
end
end
return draw

View File

@ -47,15 +47,13 @@ local update = function(cr)
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 current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
TextColumn.draw(labels, cr)
TextColumn.draw(info, cr)
end
end
return draw

View File

@ -209,10 +209,9 @@ _RIGHT_X_ = nil
_CORE_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)
if current_interface == 0 then
Text.draw(header.text, cr)
Line.draw(header.underline, cr)
@ -229,7 +228,6 @@ local draw = function(cr, current_interface, update_frequency, is_using_ac)
Text.draw(battery_draw.label, cr)
Text.draw(battery_draw.value, cr)
ScalePlot.draw(battery_draw.plot, cr)
end
end
return draw

View File

@ -249,10 +249,9 @@ _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)
@ -277,7 +276,6 @@ local draw = function(cr, current_interface)
LabelPlot.draw(plot, cr)
Table.draw(tbl, cr)
end
end
return draw

View File

@ -117,10 +117,9 @@ local update = function(cr, update_frequency)
update_stat(cr, writes, write_byte_cnt, update_frequency)
end
local draw = function(cr, current_interface, 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)
@ -131,7 +130,6 @@ local draw = function(cr, current_interface, update_frequency)
Text.draw(writes.label, cr)
Text.draw(writes.rate, cr)
ScalePlot.draw(writes.plot, cr)
end
end
return draw

View File

@ -42,7 +42,7 @@ local info = _G_Widget_.TextColumn{
_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'))
if log_is_changed then
@ -52,12 +52,10 @@ local draw = function(cr, current_interface, log_is_changed)
"'/ 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
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)