From 554a8ced0dd0796a0e6a12a0a942543a985cccf2 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Tue, 16 Aug 2022 23:52:25 -0400 Subject: [PATCH] REF make id's more legit --- src/modules/filesystem.lua | 12 ++++++------ src/modules/graphics.lua | 6 ++++-- src/modules/memory.lua | 3 ++- src/modules/pacman.lua | 6 +++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/modules/filesystem.lua b/src/modules/filesystem.lua index 61cf74b..1e3ae97 100644 --- a/src/modules/filesystem.lua +++ b/src/modules/filesystem.lua @@ -4,8 +4,8 @@ local impure = require 'impure' return function(main_state, config, common, width, point) local geo = config.geometry - local SPACING = geo.bar_spacing - local SEPARATOR_SPACING = geo.sep_spacing + local bar_spacing = geo.bar_spacing + local separator_bar_spacing = geo.sep_spacing ----------------------------------------------------------------------------- -- smartd @@ -50,7 +50,7 @@ return function(main_state, config, common, width, point) -- relative to the right edge of the text column geo.bar_pad, names, - SPACING, + bar_spacing, 12, 80 ) @@ -64,7 +64,7 @@ return function(main_state, config, common, width, point) end return common.mk_acc( width, - (#config.fs_paths - 1) * SPACING, + (#config.fs_paths - 1) * bar_spacing, update, pure.partial(common.compound_bar_draw_static, obj), pure.partial(common.compound_bar_draw_dynamic, obj) @@ -79,7 +79,7 @@ return function(main_state, config, common, width, point) point = point, width = width, set_state = nil, - top = {{mk_smart, config.show_smart, SEPARATOR_SPACING}}, - common.mk_section(SEPARATOR_SPACING, {mk_bars, true, 0}) + top = {{mk_smart, config.show_smart, separator_bar_spacing}}, + common.mk_section(separator_bar_spacing, {mk_bars, true, 0}) } end diff --git a/src/modules/graphics.lua b/src/modules/graphics.lua index add0293..fa5e443 100644 --- a/src/modules/graphics.lua +++ b/src/modules/graphics.lua @@ -2,13 +2,15 @@ local pure = require 'pure' local i_o = require 'i_o' return function(update_freq, config, common, width, point) + local NA = 'N/A' + local NVIDIA_EXE = 'nvidia-settings' + local geo = config.geometry local sep_spacing = geo.sep_spacing local text_spacing = geo.text_spacing local plot_sec_break = geo.plot.sec_break local plot_height = geo.plot.height - local NA = 'N/A' - local NVIDIA_EXE = 'nvidia-settings' + local __string_match = string.match local __string_format = string.format local __tonumber = tonumber diff --git a/src/modules/memory.lua b/src/modules/memory.lua index e7f1b7a..699c6e6 100644 --- a/src/modules/memory.lua +++ b/src/modules/memory.lua @@ -5,12 +5,13 @@ local pure = require 'pure' local sys = require 'sys' return function(update_freq, config, common, width, point) - local geo = config.geometry local dial_thickness = 8 local dial_radius = 32 local dial_x_spacing = 40 local cache_y_offset = 7 local cache_x_offset = 50 + + local geo = config.geometry local plot_sec_break = geo.plot.sec_break local plot_height = geo.plot.height local table_sec_break = geo.table.sec_break diff --git a/src/modules/pacman.lua b/src/modules/pacman.lua index 88130f8..156bc82 100644 --- a/src/modules/pacman.lua +++ b/src/modules/pacman.lua @@ -1,7 +1,7 @@ local pure = require 'pure' return function(main_state, config, common, width, point) - local TEXT_SPACING = config.geometry.text_spacing + local text_spacing = config.geometry.text_spacing local __string_match = string.match local __string_gmatch = string.gmatch @@ -11,7 +11,7 @@ return function(main_state, config, common, width, point) point.x, y, width, - TEXT_SPACING, + text_spacing, {'Total', 'Explicit', 'Outdated', 'Orphaned', 'Local'} ) local update = function() @@ -33,7 +33,7 @@ return function(main_state, config, common, width, point) end return common.mk_acc( width, - TEXT_SPACING * 4, + text_spacing * 4, update, pure.partial(common.text_rows_draw_static, obj), pure.partial(common.text_rows_draw_dynamic, obj)