From 59fdd00caa361b75c27f185ee96d0631767b0e89 Mon Sep 17 00:00:00 2001 From: bysmuth Date: Wed, 3 Mar 2021 12:24:56 +0100 Subject: [PATCH] added icon and necessary code --- docs/layouts/layout.md | 5 +++++ icons/layouts/equalarea.png | Bin 0 -> 5502 bytes layout/equalarea.lua | 26 ++++++++++++++++++++------ layout/init.lua | 2 +- 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 icons/layouts/equalarea.png 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 0000000000000000000000000000000000000000..47164a98770ef5fa6ce165c8db3b9f5adcbfcf8f GIT binary patch literal 5502 zcmeHLdsq`!79VgC#Zp1RBK0u@wN*?qd6CBwPr<77g%pGef-Wjm6pK|^!AHAxsjI@)YTY{lA+*-6-?#nG$(P5y_ji8h z+}}Ot-pu4EBf?x=yj>s&a+QaNs=#+3{r=N1@EISb`yPUZg=R&^Q!3N~8%?B^(BUwZ zX~bdNN@yX-+WvjPU-GZOudTeEAS=k85~vn?HH)tX6}%7S8dB_@%BB<+t5?5|7q+TW-6aT>r_Y@6Vr~ z_0((Eh1yFV4{ogV+4Ixdn~&yPlkU6f)jsi*vi{D&tIBJxBS~S3P9xmT889Se6(dCO^Hk>I}nBIB9QXKjSx-Wy%) z=*q+y$?L9-Kfa7XylL?|`npzfrK;1T+xhw#w;8>jpQv~8DflryctMH#(k)X<3qyKhVY23t(+<_N;rS8Eygk1=c=oVrWqqxm z-@;oiN~}3lZ1(Jic)7t_Vh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Z$EYg(B=7_~&Ho|3dxlDjynllX)YGoSCzBEN2M<{N_OoWjlNCQlBqG~dok}?=z z9PTFvqnOMJI{O{aZ5zFr(y-;A!3XmJ05%svL`;OsFF5PVJGu@2SUADM&8Z8?H zW%F!r6DC(E2W)5=lL@`iW{04aN=usbQpSA3kZv6uh$i%S6ot~Far`-aA%`ar@ZA-hR+y%=l@uJ%Uo4XOBxWf%>ed`z`tUON+B(V|BYu5 zI=~WSqAa8-HPRHRUV>xPi+P?09$->|z0ORTGUdNBsbAm%`qDKV*pjA9JO5F5T3@Sg zL(&m8sbJW)2}n?^Pku9+fop6_0Cemd!ctH}G7fgz{!)9^Pdq1$IS3!;X%Upk;qx$% z#$tpiMtKNRgbBnNE>6FAL)p!wma?EGJSZ9D09a>GTDEnD-?nAn^r2`=3J!9_58+4< zgweOWZ~&X$P@hdNfZlQx3W>b{0rZw6k<*zMm2NcZ2;4MOm}iOd8#p`r{-pdpb9-2y zbqHz91Vx)dMOq9mbpIS+AH#eC!wqKgMWNe6`ed;?cRwm~aw8>6>vM+vV%)%lPf9`btv+fI3jBh$txV)@AU75^_+_3k!u- zJ53A+jgiLi1T%Qn*+#z|g5Tb31)a{6Tp@G5Im~e^?C-mK)@9JOKpq+t9o~p7_VUQC zp5WrL{<0E^&2DB+jzMxgK9N}*RymeupLMysU~IAji)3)hK83_di(|4I>ZrKDmJQU1 pvIS11E~~aWHZO6n7~u^bC!~HGk-hAmMGnXzxhx`dZ}8&f{{_S>^y>fs literal 0 HcmV?d00001 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,