REF use general pattern names

This commit is contained in:
Nathan Dwarshuis 2021-07-04 19:50:55 -04:00
parent d0494859f2
commit ed505d0e15
11 changed files with 51 additions and 53 deletions

2
core

@ -1 +1 @@
Subproject commit 9e4911a6f5e0cad3756d8326467588e3970029e3
Subproject commit 7b8e82ee6a5c3c18133c1edc0f7247b3d20b4cb3

View File

@ -40,7 +40,7 @@ local smart = {
x = _G_INIT_DATA_.RIGHT_X + _G_INIT_DATA_.SECTION_WIDTH,
y = header.bottom_y,
x_align = 'right',
text_color = Patterns.BLUE,
text_color = Patterns.PRIMARY_FG,
text = '<smartd>',
}
}

View File

@ -35,7 +35,7 @@ local status = {
x = _RIGHT_X_,
y = header.bottom_y,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<status>'
}
}
@ -59,7 +59,7 @@ local internal_temp = {
x = _RIGHT_X_,
y = _INTERNAL_TEMP_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<gpu_temp>'
}
}
@ -86,7 +86,7 @@ local clock_speed = {
y = _CLOCK_SPEED_Y_,
spacing = _TEXT_SPACING_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
num_rows = 2
}
}
@ -110,7 +110,7 @@ local gpu_util = {
x = _RIGHT_X_,
y = _GPU_UTIL_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<gpu_util>'
},
plot = _G_Widget_.LabelPlot{
@ -133,7 +133,7 @@ local mem_util = {
x = _RIGHT_X_,
y = _MEM_UTIL_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<mem_util>'
},
plot = _G_Widget_.LabelPlot{
@ -156,7 +156,7 @@ local vid_util = {
x = _RIGHT_X_,
y = _VID_UTIL_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<vid_util>'
},
plot = _G_Widget_.LabelPlot{

View File

@ -70,7 +70,7 @@ local cache_arc = _G_Widget_.Arc{
y = DIAL_Y,
radius = DIAL_RADIUS,
thickness = _DIAL_THICKNESS_,
arc_pattern = _G_Patterns_.PURPLE_ROUNDED
arc_pattern = _G_Patterns_.INDICATOR_FG_SECONDARY
}
local total_used = _G_Widget_.CriticalText{
@ -86,7 +86,8 @@ local inner_ring = _G_Widget_.Arc{
y = DIAL_Y,
radius = DIAL_RADIUS - _DIAL_THICKNESS_ / 2 - 2,
theta0 = 0,
theta1 = 360
theta1 = 360,
arc_pattern = _G_Patterns_.BORDER_FG
}
local _LINE_1_Y_ = header.bottom_y + _TEXT_Y_OFFSET_
@ -122,7 +123,7 @@ local cache = {
y = _LINE_1_Y_ + _TEXT_SPACING_,
x_align = 'right',
append_end = ' %',
text_color = _G_Patterns_.PURPLE,
text_color = _G_Patterns_.SECONDARY_FG,
'<cached_kb>',
'<buffers_kb>',
'<kernel_slab>'

View File

@ -35,7 +35,7 @@ local dnload = {
x = _RIGHT_X_,
y = header.bottom_y,
x_align = 'right',
text_color = _G_Patterns_.BLUE
text_color = _G_Patterns_.PRIMARY_FG
},
plot = _G_Widget_.ScalePlot{
x = _G_INIT_DATA_.CENTER_RIGHT_X,
@ -58,7 +58,7 @@ local upload = {
x = _RIGHT_X_,
y = _UPLOAD_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE
text_color = _G_Patterns_.PRIMARY_FG
},
plot = _G_Widget_.ScalePlot{
x = _G_INIT_DATA_.CENTER_RIGHT_X,

View File

@ -32,7 +32,7 @@ local info = _G_Widget_.TextColumn{
y = header.bottom_y,
spacing = _TEXT_SPACING_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
num_rows = 5
}

View File

@ -41,7 +41,7 @@ local pkg0 = {
x = _RIGHT_X_,
y = header.bottom_y,
x_align = 'right',
text_color = Patterns.BLUE,
text_color = Patterns.PRIMARY_FG,
text = '<core>',
append_end = ' W',
},
@ -66,7 +66,7 @@ local dram = {
x = _RIGHT_X_,
y = _CORE_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<dram>',
append_end = ' W'
},

View File

@ -75,7 +75,8 @@ local _create_core_ = function(cores, id, x, y)
y = y,
radius = _DIAL_INNER_RADIUS_ - 2,
theta0 = 0,
theta1 = 360
theta1 = 360,
arc_pattern = _G_Patterns_.BORDER_FG
},
coretemp_text = _G_Widget_.CriticalText{
x = x,
@ -122,7 +123,7 @@ local hwp = {
x = _RIGHT_X_,
y = _HWP_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<hwp_pref>'
}
}
@ -139,7 +140,7 @@ local ave_freq = {
x = _RIGHT_X_,
y = _FREQ_Y_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
text = '<freq>'
}
}

View File

@ -68,7 +68,7 @@ local reads = {
y = header.bottom_y,
x_align = 'right',
append_end=' B/s',
text_color = _G_Patterns_.BLUE
text_color = _G_Patterns_.PRIMARY_FG
},
plot = _G_Widget_.ScalePlot{
x = _G_INIT_DATA_.CENTER_LEFT_X,
@ -92,7 +92,7 @@ local writes = {
y = _WRITE_Y_,
x_align = 'right',
append_end =' B/s',
text_color = _G_Patterns_.BLUE
text_color = _G_Patterns_.PRIMARY_FG
},
plot = _G_Widget_.ScalePlot{
x = _G_INIT_DATA_.CENTER_LEFT_X,

View File

@ -30,14 +30,14 @@ local kernel = _G_Widget_.Text{
y = header.bottom_y,
x_align = 'right',
text = Util.conky('$kernel'),
text_color = _G_Patterns_.BLUE
text_color = _G_Patterns_.PRIMARY_FG
}
local info = _G_Widget_.TextColumn{
x = _G_INIT_DATA_.LEFT_X + _G_INIT_DATA_.SECTION_WIDTH,
y = header.bottom_y + _TEXT_SPACING_,
spacing = _TEXT_SPACING_,
x_align = 'right',
text_color = _G_Patterns_.BLUE,
text_color = _G_Patterns_.PRIMARY_FG,
'<row1>',
'<row2>',
'<row3>'

View File

@ -4,53 +4,49 @@ local Color = require 'Color'
local Util = require 'Util'
-- text colors
M.WHITE = Color.init{hex_rgba = 0xffffff}
M.HEADER_FG = Color.init{hex_rgba = 0xffffff}
M.LIGHT_GREY = Color.init{hex_rgba = 0xeeeeee}
M.INACTIVE_TEXT_FG = Color.init{hex_rgba = 0xeeeeee}
-- TODO this is also the plot label color
M.MID_GREY = Color.init{hex_rgba = 0xd6d6d6}
M.DARK_GREY = Color.init{hex_rgba = 0x888888}
M.BORDER_FG = Color.init{hex_rgba = 0x888888}
M.PRIMARY_FG = Color.init{hex_rgba = 0xbfe1ff}
M.SECONDARY_FG = Color.init{hex_rgba = 0xcb91ff}
M.TERTIARY_FG = Color.init{hex_rgba = 0xefe7aa}
M.CRITICAL_FG = Color.init{hex_rgba = 0xff8282}
M.BLUE = Color.init{hex_rgba = 0xbfe1ff}
M.RED = Color.init{hex_rgba = 0xff8282}
M.PURPLE = Color.init{hex_rgba = 0xcb91ff}
M.YELLOW = Color.init{hex_rgba = 0xefe7aa
}
-- arc patterns
local GREY2 = 0xbfbfbf
local GREY5 = 0x565656
M.GREY_ROUNDED = Color.Gradient{
M.INDICATOR_BG = Color.Gradient{
Color.ColorStop{hex_rgba = GREY5, stop = 0.0},
Color.ColorStop{hex_rgba = GREY2, stop = 0.5},
Color.ColorStop{hex_rgba = GREY5, stop = 1.0}
Color.ColorStop{hex_rgba = GREY5, stop = 1.0}
}
local BLUE1 = 0x99CEFF
local BLUE3 = 0x316BA6
M.BLUE_ROUNDED = Color.Gradient{
M.INDICATOR_FG_PRIMARY = Color.Gradient{
Color.ColorStop{hex_rgba = BLUE3, stop = 0.0},
Color.ColorStop{hex_rgba = BLUE1, stop = 0.5},
Color.ColorStop{hex_rgba = BLUE3, stop = 1.0}
}
local RED1 = 0xFF3333
local RED3 = 0xFFB8B8
M.RED_ROUNDED = Color.Gradient{
Color.ColorStop{hex_rgba = RED1, stop = 0.0},
Color.ColorStop{hex_rgba = RED3, stop = 0.5},
Color.ColorStop{hex_rgba = RED1, stop = 1.0}
}
local PURPLE1 = 0xeecfff
local PURPLE3 = 0x9523ff
M.PURPLE_ROUNDED = Color.Gradient{
M.INDICATOR_FG_SECONDARY = Color.Gradient{
Color.ColorStop{hex_rgba = PURPLE3, stop = 0.0},
Color.ColorStop{hex_rgba = PURPLE1, stop = 0.5},
Color.ColorStop{hex_rgba = PURPLE3, stop = 1.0}
}
M.TRANSPARENT_BLUE = Color.Gradient{
Color.ColorStop{hex_rgba = BLUE3, stop = 0.0, alpha = 0.2},
Color.ColorStop{hex_rgba = BLUE1, stop = 1.0, alpha = 1.0}
local RED1 = 0xFF3333
local RED3 = 0xFFB8B8
M.INDICATOR_FG_CRITICAL = Color.Gradient{
Color.ColorStop{hex_rgba = RED1, stop = 0.0},
Color.ColorStop{hex_rgba = RED3, stop = 0.5},
Color.ColorStop{hex_rgba = RED1, stop = 1.0}
}
-- plot patterns
@ -58,12 +54,12 @@ local PLOT_BLUE1 = 0x003f7c
local PLOT_BLUE2 = 0x1e90ff
local PLOT_BLUE3 = 0x316ece
local PLOT_BLUE4 = 0x8cc7ff
M.PLOT_LINE_BLUE = Color.Gradient{
M.PLOT_FILL_BORDER_PRIMARY = Color.Gradient{
Color.ColorStop{hex_rgba = PLOT_BLUE1, stop = 0.0},
Color.ColorStop{hex_rgba = PLOT_BLUE2, stop = 1.0}
}
M.PLOT_FILL_BLUE = Color.Gradient{
M.PLOT_FILL_BG_PRIMARY = Color.Gradient{
Color.ColorStop{hex_rgba = PLOT_BLUE3, stop = 0.0, alpha = 0.2},
Color.ColorStop{hex_rgba = PLOT_BLUE4, stop = 1.0, alpha = 1.0}
}
@ -72,12 +68,12 @@ local PLOT_PURPLE1 = 0x3e0077
local PLOT_PURPLE2 = 0x9523ff
local PLOT_PURPLE3 = 0x7a30a3
local PLOT_PURPLE4 = 0xeac4ff
M.PLOT_LINE_PURPLE = Color.Gradient{
M.PLOT_FILL_BORDER_SECONDARY = Color.Gradient{
Color.ColorStop{hex_rgba = PLOT_PURPLE1, stop = 0.0},
Color.ColorStop{hex_rgba = PLOT_PURPLE2, stop = 1.0}
}
M.PLOT_FILL_PURPLE = Color.Gradient{
M.PLOT_FILL_BG_SECONDARY = Color.Gradient{
Color.ColorStop{hex_rgba = PLOT_PURPLE3, stop = 0.0, alpha = 0.2},
Color.ColorStop{hex_rgba = PLOT_PURPLE4, stop = 1.0, alpha = 1.0}
}
@ -86,18 +82,18 @@ local PLOT_YELLOW1 = 0x231f00
local PLOT_YELLOW2 = 0x7c6f00
local PLOT_YELLOW3 = 0x8c8225
local PLOT_YELLOW4 = 0xfff387
M.PLOT_LINE_YELLOW = Color.Gradient{
M.PLOT_FILL_BORDER_TERTIARY = Color.Gradient{
Color.ColorStop{hex_rgba = PLOT_YELLOW1, stop = 0.0},
Color.ColorStop{hex_rgba = PLOT_YELLOW2, stop = 1.0}
}
M.PLOT_FILL_YELLOW = Color.Gradient{
M.PLOT_FILL_BG_TERTIARY = Color.Gradient{
Color.ColorStop{hex_rgba = PLOT_YELLOW3, stop = 0.0, alpha = 0.2},
Color.ColorStop{hex_rgba = PLOT_YELLOW4, stop = 1.0, alpha = 1.0}
}
-- panel pattern
M.TRANSPARENT_BLACK = Color.init{hex_rgba = 0x000000, alpha = 0.7}
M.PANEL_BG = Color.init{hex_rgba = 0x000000, alpha = 0.7}
M = Util.set_finalizer(M, function() print('Cleaning up Patterns.lua') end)