diff --git a/docs/layouts/layout.md b/docs/layouts/layout.md index 1b6c93c..6f3109f 100644 --- a/docs/layouts/layout.md +++ b/docs/layouts/layout.md @@ -43,3 +43,8 @@ theme.mstab_tabbar_style = "default" -- style of the tabbar ("default", " ![](https://media.discordapp.net/attachments/769673106842845194/780095998239834142/unknown.png) *screenshot by [branwright](https://github.com/branwright1)* + +#### Equal area +![](https://imgur.com/a/qt3qxyT) + +*screenshot by [bysmutheye](https://github.com/bysmutheye)* diff --git a/icons/layouts/equalarea.png b/icons/layouts/equalarea.png new file mode 100644 index 0000000..47164a9 Binary files /dev/null and b/icons/layouts/equalarea.png differ diff --git a/layout/equalarea.lua b/layout/equalarea.lua index cc48545..9a89191 100644 --- a/layout/equalarea.lua +++ b/layout/equalarea.lua @@ -1,7 +1,11 @@ +local gears = require("gears") +local gcolor = require("gears.color") +local beautiful = require("beautiful") local math = math local screen = screen -local tonumber = tonumber -local equalarea = {name = "equalarea"} +local mylayout = {} +mylayout.name = "equalarea" + local function divide(p,g,low,high,cls,mwfact,mcount) if low == high then p.geometries[cls[low]] = g @@ -47,7 +51,7 @@ local function divide(p,g,low,high,cls,mwfact,mcount) return end -local function arrange(p) +function mylayout.arrange(p) local t = p.tag or screen[p.screen].selected_tag local wa = p.workarea local cls = p.clients @@ -63,8 +67,18 @@ local function arrange(p) divide(p,g,1,#cls,cls,mwfact,mcount) end -function equalarea.arrange(p) - return arrange(p) +local icon_raw = gears.filesystem.get_configuration_dir() .. tostring(...):match("^.*bling"):gsub("%.", "/") .. "/icons/layouts/equalarea.png" + +local function get_icon() + if icon_raw ~= nil then + return gcolor.recolor_image(icon_raw, beautiful.fg_normal) + else + return nil + end end -return {layout = equalarea} +return { + layout = mylayout, + icon_raw = icon_raw, + get_icon = get_icon, +} diff --git a/layout/init.lua b/layout/init.lua index 9bbf8ab..452bce8 100644 --- a/layout/init.lua +++ b/layout/init.lua @@ -13,8 +13,8 @@ local centered = require(... .. ".centered") beautiful.layout_centered = centered.get_icon() local equalarea = require(... .. ".equalarea") +beautiful.layout_equalarea = equalarea.get_icon() -beautiful.layout_centered = centered.get_icon() local layout = { mstab = mstab.layout, centered = centered.layout,