chore: do not alter global `table`
This commit is contained in:
parent
fcd5bd1109
commit
abb0860f03
7
init.lua
7
init.lua
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue