added icon and necessary code
This commit is contained in:
parent
5bcb519e75
commit
59fdd00caa
|
@ -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)*
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue