rename temp global variable

This commit is contained in:
petrucci4prez 2017-07-16 13:56:13 -04:00
parent 8275b64a2a
commit 71d90d542e
12 changed files with 133 additions and 133 deletions

View File

@ -2,22 +2,22 @@ local Widget = require 'Widget'
local FillRect = require 'FillRect'
local left = Widget.Panel{
x = CONSTRUCTION_GLOBAL.LEFT_X - CONSTRUCTION_GLOBAL.PANEL_MARGIN_X,
y = CONSTRUCTION_GLOBAL.TOP_Y - CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2,
height = CONSTRUCTION_GLOBAL.SIDE_HEIGHT + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2,
x = G_DIMENSIONS_.LEFT_X - G_DIMENSIONS_.PANEL_MARGIN_X,
y = G_DIMENSIONS_.TOP_Y - G_DIMENSIONS_.PANEL_MARGIN_Y,
width = G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2,
height = G_DIMENSIONS_.SIDE_HEIGHT + G_DIMENSIONS_.PANEL_MARGIN_Y * 2,
}
local center = Widget.Panel{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X - CONSTRUCTION_GLOBAL.PANEL_MARGIN_X,
y = CONSTRUCTION_GLOBAL.TOP_Y - CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y,
width = CONSTRUCTION_GLOBAL.CENTER_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2 + CONSTRUCTION_GLOBAL.CENTER_PAD,
height = CONSTRUCTION_GLOBAL.CENTER_HEIGHT + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2,
x = G_DIMENSIONS_.CENTER_LEFT_X - G_DIMENSIONS_.PANEL_MARGIN_X,
y = G_DIMENSIONS_.TOP_Y - G_DIMENSIONS_.PANEL_MARGIN_Y,
width = G_DIMENSIONS_.CENTER_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_Y * 2 + G_DIMENSIONS_.CENTER_PAD,
height = G_DIMENSIONS_.CENTER_HEIGHT + G_DIMENSIONS_.PANEL_MARGIN_Y * 2,
}
local right = Widget.Panel{
x = CONSTRUCTION_GLOBAL.RIGHT_X - CONSTRUCTION_GLOBAL.PANEL_MARGIN_X,
y = CONSTRUCTION_GLOBAL.TOP_Y - CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2,
height = CONSTRUCTION_GLOBAL.SIDE_HEIGHT + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2,
x = G_DIMENSIONS_.RIGHT_X - G_DIMENSIONS_.PANEL_MARGIN_X,
y = G_DIMENSIONS_.TOP_Y - G_DIMENSIONS_.PANEL_MARGIN_Y,
width = G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2,
height = G_DIMENSIONS_.SIDE_HEIGHT + G_DIMENSIONS_.PANEL_MARGIN_Y * 2,
}
Widget = nil

View File

@ -74,7 +74,7 @@ package.path = ABS_PATH..'/?.lua;'..
local UPDATE_FREQUENCY = 1 --Hz
CONSTRUCTION_GLOBAL = {
G_DIMENSIONS_ = {
UPDATE_INTERVAL = 1 / UPDATE_FREQUENCY,
LEFT_X = 32,
@ -91,14 +91,14 @@ CONSTRUCTION_GLOBAL = {
ABS_PATH = ABS_PATH
}
CONSTRUCTION_GLOBAL.CENTER_LEFT_X = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2 + CONSTRUCTION_GLOBAL.PANEL_HORZ_SPACING
CONSTRUCTION_GLOBAL.CENTER_RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.CENTER_PAD
CONSTRUCTION_GLOBAL.CENTER_WIDTH = CONSTRUCTION_GLOBAL.SECTION_WIDTH * 2 + CONSTRUCTION_GLOBAL.CENTER_PAD
CONSTRUCTION_GLOBAL.RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.CENTER_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2 + CONSTRUCTION_GLOBAL.PANEL_HORZ_SPACING
G_DIMENSIONS_.CENTER_LEFT_X = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2 + G_DIMENSIONS_.PANEL_HORZ_SPACING
G_DIMENSIONS_.CENTER_RIGHT_X = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.CENTER_PAD
G_DIMENSIONS_.CENTER_WIDTH = G_DIMENSIONS_.SECTION_WIDTH * 2 + G_DIMENSIONS_.CENTER_PAD
G_DIMENSIONS_.RIGHT_X = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.CENTER_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2 + G_DIMENSIONS_.PANEL_HORZ_SPACING
ABS_PATH = nil
conky_set_update_interval(CONSTRUCTION_GLOBAL.UPDATE_INTERVAL)
conky_set_update_interval(G_DIMENSIONS_.UPDATE_INTERVAL)
require 'imlib2'
require 'cairo'
@ -129,7 +129,7 @@ unrequire('Gradient')
unrequire = nil
CONSTRUCTION_GLOBAL = nil
G_DIMENSIONS_ = nil
local _CAIRO_XLIB_SURFACE_CREATE = cairo_xlib_surface_create
local _CAIRO_CREATE = cairo_create

View File

@ -22,16 +22,16 @@ local SPACING = 20
local BAR_PAD = 100
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = MODULE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = 'FILE SYSTEMS'
}
local HEADER_BOTTOM_Y = header.bottom_y
local labels = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = HEADER_BOTTOM_Y,
spacing = SPACING,
'root',
@ -46,7 +46,7 @@ local labels = Widget.TextColumn{
--~ for i = 1, FS_NUM do
--~ totals[i] = Widget.CriticalText{
--~ x = CONSTRUCTION_GLOBAL.RIGHT_X + TEXT_WIDTH,
--~ x = G_DIMENSIONS_.RIGHT_X + TEXT_WIDTH,
--~ y = HEADER_BOTTOM_Y + (i - 1) * SPACING,
--~ x_align = 'right',
--~ text_color = schema.blue,
@ -66,11 +66,11 @@ for i, v in _PAIRS(FS_PATHS) do
end
local bars = Widget.CompoundBar{
--~ x = CONSTRUCTION_GLOBAL.RIGHT_X + TEXT_WIDTH + BAR_PAD,
x = CONSTRUCTION_GLOBAL.RIGHT_X + BAR_PAD,
--~ x = G_DIMENSIONS_.RIGHT_X + TEXT_WIDTH + BAR_PAD,
x = G_DIMENSIONS_.RIGHT_X + BAR_PAD,
y = HEADER_BOTTOM_Y,
--~ length = CONSTRUCTION_GLOBAL.SECTION_WIDTH - (TEXT_WIDTH + BAR_PAD),
length = CONSTRUCTION_GLOBAL.SECTION_WIDTH - BAR_PAD,
--~ length = G_DIMENSIONS_.SECTION_WIDTH - (TEXT_WIDTH + BAR_PAD),
length = G_DIMENSIONS_.SECTION_WIDTH - BAR_PAD,
spacing = SPACING,
num_bars = FS_NUM,
critical_limit = '>0.8'

View File

@ -17,17 +17,17 @@ local PLOT_SEC_BREAK = 20
local PLOT_HEIGHT = 56
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = MODULE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = 'NVIDIA GRAPHICS'
}
local RIGHT_X = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
local RIGHT_X = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH
local status = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = header.bottom_y,
text = 'Status'
},
@ -43,7 +43,7 @@ local status = {
local SEP_Y_1 = header.bottom_y + SEPARATOR_SPACING
local separator1 = Widget.Line{
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y_1},
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y_1},
p2 = {x = RIGHT_X, y = SEP_Y_1}
}
@ -51,7 +51,7 @@ local INTERNAL_TEMP_Y = SEP_Y_1 + SEPARATOR_SPACING
local internal_temp = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = INTERNAL_TEMP_Y,
text = 'Internal Temperature'
},
@ -68,7 +68,7 @@ local PCI_UTIL_Y = INTERNAL_TEMP_Y + TEXT_SPACING
local pci_util = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = PCI_UTIL_Y,
text = 'PCI Utilization'
},
@ -84,7 +84,7 @@ local pci_util = {
local SEP_Y_2 = PCI_UTIL_Y + SEPARATOR_SPACING
local separator2 = Widget.Line{
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y_2},
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y_2},
p2 = {x = RIGHT_X, y = SEP_Y_2}
}
@ -92,14 +92,14 @@ local CLOCK_SPEED_Y = SEP_Y_2 + SEPARATOR_SPACING
local clock_speed = {
labels = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = CLOCK_SPEED_Y,
spacing = TEXT_SPACING,
'GPU Clock Speed',
'Memory Clock Speed'
},
values = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH,
y = CLOCK_SPEED_Y,
spacing = TEXT_SPACING,
x_align = 'right',
@ -111,7 +111,7 @@ local clock_speed = {
local SEP_Y_3 = CLOCK_SPEED_Y + TEXT_SPACING * 2
local separator3 = Widget.Line{
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y_3},
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y_3},
p2 = {x = RIGHT_X, y = SEP_Y_3}
}
@ -120,7 +120,7 @@ local GPU_UTIL_PLOT_Y = GPU_UTIL_Y + PLOT_SEC_BREAK
local gpu_util = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = GPU_UTIL_Y,
text = 'GPU Utilization'
},
@ -132,9 +132,9 @@ local gpu_util = {
text = '<gpu_util>'
},
plot = Widget.LabelPlot{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = GPU_UTIL_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT
}
}
@ -144,7 +144,7 @@ local MEM_UTIL_PLOT_Y = MEM_UTIL_Y + PLOT_SEC_BREAK
local mem_util = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = MEM_UTIL_Y,
text = 'Memory Utilization'
},
@ -156,9 +156,9 @@ local mem_util = {
text = '<mem_util>'
},
plot = Widget.LabelPlot{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = MEM_UTIL_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT
}
}
@ -168,7 +168,7 @@ local VID_UTIL_PLOT_Y = VID_UTIL_Y + PLOT_SEC_BREAK
local vid_util = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = VID_UTIL_Y,
text = 'Video Utilization'
},
@ -180,9 +180,9 @@ local vid_util = {
text = '<vid_util>'
},
plot = Widget.LabelPlot{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = VID_UTIL_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT
}
}

View File

@ -42,16 +42,16 @@ local TABLE_SECTION_BREAK = 20
local TABLE_HEIGHT = 114
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = MODULE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = "MEMORY"
}
local HEADER_BOTTOM_Y = header.bottom_y
--don't nil these
local DIAL_X = CONSTRUCTION_GLOBAL.RIGHT_X + DIAL_RADIUS + DIAL_THICKNESS * 0.5
local DIAL_X = G_DIMENSIONS_.RIGHT_X + DIAL_RADIUS + DIAL_THICKNESS * 0.5
local DIAL_Y = HEADER_BOTTOM_Y + DIAL_RADIUS + DIAL_THICKNESS * 0.5
local dial = Widget.Dial{
@ -85,8 +85,8 @@ local inner_ring = Widget.Arc{
}
local LINE_1_Y = HEADER_BOTTOM_Y + TEXT_Y_OFFSET
local TEXT_LEFT_X = CONSTRUCTION_GLOBAL.RIGHT_X + DIAL_RADIUS * 2 + TEXT_LEFT_X_OFFSET
local RIGHT_X = CONSTRUCTION_GLOBAL.RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
local TEXT_LEFT_X = G_DIMENSIONS_.RIGHT_X + DIAL_RADIUS * 2 + TEXT_LEFT_X_OFFSET
local RIGHT_X = G_DIMENSIONS_.RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH
local swap= {
label = Widget.Text{
@ -127,18 +127,18 @@ local cache = {
local PLOT_Y = PLOT_SECTION_BREAK + HEADER_BOTTOM_Y + DIAL_RADIUS * 2
local plot = Widget.LabelPlot{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT
}
local TABLE_Y = PLOT_Y + PLOT_HEIGHT + TABLE_SECTION_BREAK
local tbl = Widget.Table{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = TABLE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = TABLE_HEIGHT,
'Name',
'PID',

View File

@ -27,18 +27,18 @@ local __network_label_function = function(bytes)
end
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.CENTER_RIGHT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = "NETWORK"
}
local RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
local RIGHT_X = G_DIMENSIONS_.CENTER_RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH
local DOWNLOAD_PLOT_Y = header.bottom_y + PLOT_SEC_BREAK
local dnload = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
x = G_DIMENSIONS_.CENTER_RIGHT_X,
y = header.bottom_y,
text = 'Download',
},
@ -49,9 +49,9 @@ local dnload = {
text_color = schema.blue
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
x = G_DIMENSIONS_.CENTER_RIGHT_X,
y = DOWNLOAD_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __network_label_function
}
@ -62,7 +62,7 @@ local UPLOAD_PLOT_Y = UPLOAD_Y + PLOT_SEC_BREAK
local upload = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
x = G_DIMENSIONS_.CENTER_RIGHT_X,
y = UPLOAD_Y,
text = 'Upload',
},
@ -73,9 +73,9 @@ local upload = {
text_color = schema.blue
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
x = G_DIMENSIONS_.CENTER_RIGHT_X,
y = UPLOAD_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __network_label_function
}

View File

@ -10,14 +10,14 @@ local schema = require 'default_patterns'
local TEXT_SPACING = 20
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.RIGHT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = "PACMAN"
}
local labels = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = header.bottom_y,
spacing = TEXT_SPACING,
'Total',
@ -27,7 +27,7 @@ local labels = Widget.TextColumn{
'Local'
}
local info = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH,
y = header.bottom_y,
spacing = TEXT_SPACING,
x_align = 'right',

View File

@ -25,17 +25,17 @@ local __calculate_power = function(cr, prev_cnt, cnt, update_frequency)
end
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = MODULE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = 'POWER'
}
local RIGHT_X = CONSTRUCTION_GLOBAL.RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
local RIGHT_X = G_DIMENSIONS_.RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH
local pp01 = {
labels = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = header.bottom_y,
spacing = TEXT_SPACING,
'Core',
@ -55,7 +55,7 @@ local pp01 = {
local SEP_Y = header.bottom_y + TEXT_SPACING + SEPARATOR_SPACING
local separator = Widget.Line{
p1 = {x = CONSTRUCTION_GLOBAL.RIGHT_X, y = SEP_Y},
p1 = {x = G_DIMENSIONS_.RIGHT_X, y = SEP_Y},
p2 = {x = RIGHT_X, y = SEP_Y}
}
@ -63,7 +63,7 @@ local PKG0_Y = SEP_Y + SEPARATOR_SPACING
local pkg0 = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = PKG0_Y,
text = 'PKG 0'
},
@ -76,9 +76,9 @@ local pkg0 = {
append_end = ' W'
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = PKG0_Y + PLOT_SEC_BREAK,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __power_label_function,
}
@ -88,7 +88,7 @@ local DRAM_Y = PKG0_Y + PLOT_SEC_BREAK * 2 + PLOT_HEIGHT
local dram = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = DRAM_Y,
text = 'DRAM'
},
@ -101,9 +101,9 @@ local dram = {
append_end = ' W'
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = DRAM_Y + PLOT_SEC_BREAK,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __power_label_function,
}
@ -113,7 +113,7 @@ local BATTERY_DRAW_Y = DRAM_Y + PLOT_SEC_BREAK * 2 + PLOT_HEIGHT
local battery_draw = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = BATTERY_DRAW_Y,
spacing = TEXT_SPACING,
text = 'Battery Draw'
@ -124,9 +124,9 @@ local battery_draw = {
x_align = 'right',
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
x = G_DIMENSIONS_.RIGHT_X,
y = BATTERY_DRAW_Y + PLOT_SEC_BREAK,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __power_label_function,
}

View File

@ -82,9 +82,9 @@ local CREATE_CORE = function(cores, id, x, y)
end
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = MODULE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = "PROCESSOR"
}
@ -94,17 +94,17 @@ local HEADER_BOTTOM_Y = header.bottom_y
local cores = {}
for c = 0, NUM_PHYSICAL_CORES - 1 do
local dial_x = CONSTRUCTION_GLOBAL.LEFT_X + DIAL_OUTER_RADIUS + (CONSTRUCTION_GLOBAL.SECTION_WIDTH - 2 * DIAL_OUTER_RADIUS) * c / 3
local dial_x = G_DIMENSIONS_.LEFT_X + DIAL_OUTER_RADIUS + (G_DIMENSIONS_.SECTION_WIDTH - 2 * DIAL_OUTER_RADIUS) * c / 3
CREATE_CORE(cores, c, dial_x, HEADER_BOTTOM_Y + DIAL_OUTER_RADIUS)
end
local RIGHT_X = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
local RIGHT_X = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH
local PROCESS_Y = HEADER_BOTTOM_Y + DIAL_OUTER_RADIUS * 2 + PLOT_SECTION_BREAK
local process = {
labels = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = PROCESS_Y,
text = 'R | S | D | T | Z'
},
@ -120,7 +120,7 @@ local process = {
local SEP_Y = PROCESS_Y + SEPARATOR_SPACING
local separator = Widget.Line{
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y},
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y},
p2 = {x = RIGHT_X, y = SEP_Y}
}
@ -128,7 +128,7 @@ local LOAD_Y = SEP_Y + SEPARATOR_SPACING
local total_load = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = LOAD_Y,
text = 'Total Load'
},
@ -144,18 +144,18 @@ local total_load = {
local PLOT_Y = LOAD_Y + PLOT_SECTION_BREAK
local plot = Widget.LabelPlot{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT
}
local TABLE_Y = PLOT_Y + PLOT_HEIGHT + TABLE_SECTION_BREAK
local tbl = Widget.Table{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = TABLE_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = TABLE_HEIGHT,
num_rows = NUM_ROWS,
'Name',

View File

@ -45,19 +45,19 @@ local __io_label_function = function(bytes)
end
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = "INPUT / OUTPUT"
}
local HEADER_BOTTOM_Y = header.bottom_y
local RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
local RIGHT_X = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH
local READS_PLOT_Y = header.bottom_y + PLOT_SEC_BREAK
local reads = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = HEADER_BOTTOM_Y,
text = 'Reads',
},
@ -69,9 +69,9 @@ local reads = {
text_color = schema.blue
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = READS_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __io_label_function,
}
@ -82,7 +82,7 @@ local WRITES_PLOT_Y = WRITE_Y + PLOT_SEC_BREAK
local writes = {
label = Widget.Text{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = WRITE_Y,
text = 'Writes',
},
@ -94,9 +94,9 @@ local writes = {
text_color = schema.blue
},
plot = Widget.ScalePlot{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = WRITES_PLOT_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
width = G_DIMENSIONS_.SECTION_WIDTH,
height = PLOT_HEIGHT,
y_label_func = __io_label_function,
}

View File

@ -17,14 +17,14 @@ local SYNC_CMD = "sed -n '/ synchronizing package lists/p' /var/log/pacman.log |
local TEXT_SPACING = 20
local header = Widget.Header{
x = CONSTRUCTION_GLOBAL.LEFT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.LEFT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = "SYSTEM"
}
local labels = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.LEFT_X,
x = G_DIMENSIONS_.LEFT_X,
y = header.bottom_y,
spacing = TEXT_SPACING,
'Kernel',
@ -33,7 +33,7 @@ local labels = Widget.TextColumn{
'Last Sync'
}
local info = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH,
y = header.bottom_y,
spacing = TEXT_SPACING,
x_align = 'right',

View File

@ -20,7 +20,7 @@ local SECTIONS = 8
local WEATHER_UPDATE_INTERVAL = 900
local WEATHER_PATH = '/tmp/weather.json'
local ICON_PATH = CONSTRUCTION_GLOBAL.ABS_PATH .. '/images/weather/'
local ICON_PATH = G_DIMENSIONS_.ABS_PATH .. '/images/weather/'
local RECENTLY_UPDATED_PATH = '/tmp/weather_recently_updated'
local NA = 'N/A'
local NA_IMAGE_PATH = ICON_PATH .. 'na.png'
@ -46,7 +46,7 @@ local __create_side_section = function(x_offset, y_offset, section_table)
}
current_widget.period = Widget.Text{
x = x_offset + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = x_offset + G_DIMENSIONS_.SECTION_WIDTH,
y = current_y,
x_align = 'right',
text_color = schema.blue
@ -84,7 +84,7 @@ local __create_side_section = function(x_offset, y_offset, section_table)
}
current_widget.info_column = Widget.TextColumn{
x = x_offset + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = x_offset + G_DIMENSIONS_.SECTION_WIDTH,
y = current_y + HEADER_PAD + 10,
spacing = SPACING,
x_align = 'right',
@ -99,7 +99,7 @@ local __create_side_section = function(x_offset, y_offset, section_table)
y = current_y + SECTION_HEIGHT - 18
},
p2 = {
x = x_offset + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = x_offset + G_DIMENSIONS_.SECTION_WIDTH,
y = current_y + SECTION_HEIGHT - 18
},
line_pattern = schema.mid_grey
@ -111,34 +111,34 @@ end
--LEFT
local left = {
header = Widget.Header{
x = CONSTRUCTION_GLOBAL.LEFT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.LEFT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = 'HOURLY FORECAST'
},
hours = {}
}
__create_side_section(CONSTRUCTION_GLOBAL.LEFT_X, left.header.bottom_y, left.hours)
__create_side_section(G_DIMENSIONS_.LEFT_X, left.header.bottom_y, left.hours)
--CENTER
local center = {}
center.header = Widget.Header{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.CENTER_WIDTH,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.CENTER_WIDTH,
header = 'CURRENT CONDITIONS'
}
center.current_desc = Widget.Text{
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
x = G_DIMENSIONS_.CENTER_LEFT_X,
y = center.header.bottom_y + 8,
text_color = schema.blue,
font_size = 24
}
local CENTER_X_1 = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH * 0.25
local CENTER_X_1 = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH * 0.25
local CENTER_ICON_WIDTH = 120
local CENTER_ICON_Y = center.header.bottom_y + 105 - CENTER_ICON_WIDTH / 2
@ -149,7 +149,7 @@ center.icon = Widget.ScaledImage{
height = CENTER_ICON_WIDTH
}
local CENTER_X_2 = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH * 0.70
local CENTER_X_2 = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH * 0.70
local INFO_Y = center.header.bottom_y + 70
center.current_temp = Widget.Text{
@ -178,7 +178,7 @@ local COLUMN_PADDING = 15
local CENTER_SPACING = SPACING + 7
center.label_column_1 = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
x = G_DIMENSIONS_.CENTER_RIGHT_X,
y = center.header.bottom_y,
spacing = CENTER_SPACING,
font_size = 14,
@ -192,7 +192,7 @@ center.label_column_1 = Widget.TextColumn{
}
center.info_column_1 = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + (CONSTRUCTION_GLOBAL.SECTION_WIDTH - COLUMN_PADDING) / 2,
x = G_DIMENSIONS_.CENTER_RIGHT_X + (G_DIMENSIONS_.SECTION_WIDTH - COLUMN_PADDING) / 2,
y = center.header.bottom_y,
x_align = 'right',
text_color = schema.blue,
@ -202,7 +202,7 @@ center.info_column_1 = Widget.TextColumn{
}
center.label_column_2 = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + (CONSTRUCTION_GLOBAL.SECTION_WIDTH + COLUMN_PADDING) / 2,
x = G_DIMENSIONS_.CENTER_RIGHT_X + (G_DIMENSIONS_.SECTION_WIDTH + COLUMN_PADDING) / 2,
y = center.header.bottom_y,
spacing = CENTER_SPACING,
font_size = 14,
@ -216,7 +216,7 @@ center.label_column_2 = Widget.TextColumn{
}
center.info_column_2 = Widget.TextColumn{
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.CENTER_RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH,
y = center.header.bottom_y,
x_align = 'right',
text_color = schema.blue,
@ -229,15 +229,15 @@ center.info_column_2 = Widget.TextColumn{
local right = {
header = Widget.Header{
x = CONSTRUCTION_GLOBAL.RIGHT_X,
y = CONSTRUCTION_GLOBAL.TOP_Y,
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
x = G_DIMENSIONS_.RIGHT_X,
y = G_DIMENSIONS_.TOP_Y,
width = G_DIMENSIONS_.SECTION_WIDTH,
header = '8 DAY FORECAST'
},
days = {}
}
__create_side_section(CONSTRUCTION_GLOBAL.RIGHT_X, right.header.bottom_y, right.days)
__create_side_section(G_DIMENSIONS_.RIGHT_X, right.header.bottom_y, right.days)
Widget = nil
schema = nil