chore: do not alter global `table`

This commit is contained in:
Aire-One 2021-12-02 23:36:38 +01:00
parent fcd5bd1109
commit abb0860f03
1 changed files with 2 additions and 5 deletions

View File

@ -171,21 +171,18 @@ _private.sticky_color = "#f6a2ed"
-- => Saving and loading of color rules
-- ============================================================
local table = table
local t = require "awesome-wm-nice.table"
table.save = t.save
table.load = t.load
-- Load the color rules or create an empty table if there aren't any
local gfilesys = require "gears.filesystem"
local config_dir = gfilesys.get_configuration_dir()
local color_rules_filename = "color_rules"
local color_rules_filepath = config_dir .. "/nice/" .. color_rules_filename
_private.color_rules = table.load(color_rules_filepath) or {}
_private.color_rules = t.load(color_rules_filepath) or {}
-- Saves the contents of _private.color_rules table to file
local function save_color_rules()
table.save(_private.color_rules, color_rules_filepath)
t.save(_private.color_rules, color_rules_filepath)
end
-- Adds a color rule entry to the color_rules table for the given client and saves to file