96 lines
2.9 KiB
Lua
96 lines
2.9 KiB
Lua
local abutton = require "awful.button"
|
|
local gtable = require "gears.table"
|
|
|
|
local config = { mt = {}, _private = {} }
|
|
|
|
-- Titlebar
|
|
config._private.titlebar_height = 38
|
|
config._private.titlebar_radius = 9
|
|
config._private.titlebar_color = "#1E1E24"
|
|
config._private.titlebar_margin_left = 0
|
|
config._private.titlebar_margin_right = 0
|
|
config._private.titlebar_font = "Sans 11"
|
|
config._private.titlebar_items = {
|
|
left = { "close", "minimize", "maximize" },
|
|
middle = "title",
|
|
right = { "sticky", "ontop", "floating" },
|
|
}
|
|
config._private.context_menu_theme = {
|
|
bg_focus = "#aed9e0",
|
|
bg_normal = "#5e6472",
|
|
border_color = "#00000000",
|
|
border_width = 0,
|
|
fg_focus = "#242424",
|
|
fg_normal = "#fefefa",
|
|
font = "Sans 11",
|
|
height = 27.5,
|
|
width = 250,
|
|
}
|
|
config._private.win_shade_enabled = true
|
|
config._private.no_titlebar_maximized = false
|
|
config._private.mb_move = abutton.names.LEFT
|
|
config._private.mb_contextmenu = abutton.names.MIDDLE
|
|
config._private.mb_resize = abutton.names.RIGHT
|
|
config._private.mb_win_shade_rollup = abutton.names.SCROLL_UP
|
|
config._private.mb_win_shade_rolldown = abutton.names.SCROLL_DOWN
|
|
|
|
-- Titlebar Items
|
|
config._private.button_size = 16
|
|
config._private.button_margin_horizontal = 5
|
|
-- _private.button_margin_vertical
|
|
config._private.button_margin_top = 2
|
|
-- _private.button_margin_bottom = 0
|
|
-- _private.button_margin_left = 0
|
|
-- _private.button_margin_right = 0
|
|
config._private.tooltips_enabled = true
|
|
config._private.tooltip_messages = {
|
|
close = "close",
|
|
minimize = "minimize",
|
|
maximize_active = "unmaximize",
|
|
maximize_inactive = "maximize",
|
|
floating_active = "enable tiling mode",
|
|
floating_inactive = "enable floating mode",
|
|
ontop_active = "don't keep above other windows",
|
|
ontop_inactive = "keep above other windows",
|
|
sticky_active = "disable sticky mode",
|
|
sticky_inactive = "enable sticky mode",
|
|
}
|
|
config._private.close_color = "#ee4266"
|
|
config._private.minimize_color = "#ffb400"
|
|
config._private.maximize_color = "#4CBB17"
|
|
config._private.floating_color = "#f6a2ed"
|
|
config._private.ontop_color = "#f6a2ed"
|
|
config._private.sticky_color = "#f6a2ed"
|
|
|
|
function config.init(args)
|
|
-- properties that are table
|
|
local table_args = {
|
|
titlebar_items = true,
|
|
context_menu_theme = true,
|
|
tooltip_messages = true,
|
|
}
|
|
|
|
-- Apply changes to our _private properties
|
|
if args then
|
|
for prop, value in pairs(args) do
|
|
if table_args[prop] == true then
|
|
gtable.crush(config._private[prop], value)
|
|
elseif prop == "titlebar_radius" then
|
|
config._private[prop] = math.max(3, value)
|
|
else
|
|
config._private[prop] = value
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
function config.mt:__index(k)
|
|
return config._private[k]
|
|
end
|
|
|
|
function config.mt:__newindex(k, v)
|
|
config._private[k] = v
|
|
end
|
|
|
|
return setmetatable(config, config.mt)
|