Add awesome extras

This commit is contained in:
2021-12-15 13:09:25 +00:00
parent e0eabd7579
commit 0cc74dd9fa
49 changed files with 6149 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
local beautiful = require("beautiful")
local gears = require("gears")
local M = {}
local relative_lua_path = tostring(...)
local function get_layout_icon_path(name)
local relative_icon_path = relative_lua_path
:match("^.*bling"):gsub("%.", "/")
.. "/icons/layouts/" .. name .. ".png"
for p in package.path:gmatch('([^;]+)') do
p = p:gsub("?.*", "")
local absolute_icon_path = p .. relative_icon_path
if gears.filesystem.file_readable(absolute_icon_path) then
return absolute_icon_path
end
end
end
local function get_icon(icon_raw)
if icon_raw ~= nil then
return gears.color.recolor_image(icon_raw, "#e6e6e6")
else
return nil
end
end
local layouts = {
"mstab",
"vertical",
"horizontal",
"centered",
"equalarea",
"deck"
}
for _, layout_name in ipairs(layouts) do
local icon_raw = get_layout_icon_path(layout_name)
beautiful["layout_" .. layout_name] = get_icon(icon_raw)
M[layout_name] = require(... .. "." .. layout_name)
end
return M