save arezzo files

This commit is contained in:
projektile 2014-09-22 11:25:27 -04:00 committed by copycat-killer
parent 1f19ecf03b
commit ced8e6d8f7
8 changed files with 203 additions and 122 deletions

View File

@ -2,12 +2,14 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
--]] --]]
local tag = require("awful.tag") local tag = require("awful.tag")
local beautiful = require("beautiful")
local cascade = local cascade =
{ {
@ -21,10 +23,23 @@ function cascade.arrange(p)
-- Cascade windows. -- Cascade windows.
-- A global border can be defined with
-- beautiful.global_border_width.
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset.
local bw = tonumber(beautiful.border_width) or 0
-- Screen. -- Screen.
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
wa.x = wa.x + global_border
wa.y = wa.y + global_border
-- Opening a new window will usually force all existing windows to -- Opening a new window will usually force all existing windows to
-- get resized. This wastes a lot of CPU time. So let's set a lower -- get resized. This wastes a lot of CPU time. So let's set a lower
-- bound to "how_many": This wastes a little screen space but you'll -- bound to "how_many": This wastes a little screen space but you'll

View File

@ -2,6 +2,7 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
@ -31,24 +32,35 @@ function cascadetile.arrange(p)
-- It's a bit hard to demonstrate the behaviour with ASCII-images... -- It's a bit hard to demonstrate the behaviour with ASCII-images...
-- --
-- (1) (2) (3) (4) -- (1) (2) (3) (4)
-- +-----+---+ +-----+---+ +-----+---+ +-----+---+ -- +----------+---+ +----------+---+ +----------+---+ +----------+---+
-- | | | | | | | | | | | 4 | -- | | | | | 3 | | | 4 | | +---+|
-- | | | | | 2 | | | 3 | | | | -- | | | -> | | | -> | +---++ -> | +---+|+
-- | 1 | | -> | 1 | | -> | 1 | | -> | 1 +---+ -- | 1 | 2 | | 1 +---++ | 1 | 3 || | 1 +---+|+|
-- | | | | +---+ | +---+ | | 3 | -- | | | | | 2 || | +---++| | +---+|+ |
-- | | | | | | | | 2 | | |---| -- | | | | | || | | 2 | | | | 2 |+ |
-- | | | | | | | |---| | | 2 | -- +----------+---+ +---------+---++ +--------+---+-+ +------+---+---+
-- | | | | | | | | | | |---|
-- +-----+---+ +-----+---+ +-----+---+ +-----+---+
-- A useless gap (like the dwm patch) can be defined with -- A useless gap (like the dwm patch) can be defined with
-- beautiful.useless_gap_width. -- beautiful.useless_gap_width.
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
if useless_gap < 0 then useless_gap = 0 end
-- A global border can be defined with
-- beautiful.global_border_width
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset
local bw = tonumber(beautiful.border_width) or 0
-- Screen. -- Screen.
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
-- Borders are factored in.
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
-- Width of main column? -- Width of main column?
local t = tag.selected(p.screen) local t = tag.selected(p.screen)
local mwfact local mwfact
@ -108,8 +120,8 @@ function cascadetile.arrange(p)
end end
g.height = wa.height g.height = wa.height
g.x = wa.x g.x = wa.x + global_border
g.y = wa.y g.y = wa.y + global_border
if useless_gap > 0 if useless_gap > 0
then then
-- Reduce width once and move window to the right. Reduce -- Reduce width once and move window to the right. Reduce
@ -138,7 +150,7 @@ function cascadetile.arrange(p)
g.width = slavewid - current_offset_x g.width = slavewid - current_offset_x
g.height = wa.height - current_offset_y g.height = wa.height - current_offset_y
g.x = wa.x + mainwid + (how_many - i) * cascadetile.offset_x g.x = wa.x + mainwid + (how_many - i) * cascadetile.offset_x
g.y = wa.y + (i - 1) * cascadetile.offset_y g.y = wa.y + (i - 1) * cascadetile.offset_y + global_border
if useless_gap > 0 if useless_gap > 0
then then
g.width = g.width - 2 * useless_gap g.width = g.width - 2 * useless_gap

View File

@ -2,6 +2,7 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010, Nicolas Estibals * (c) 2010, Nicolas Estibals
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
@ -41,15 +42,30 @@ function centerfair.arrange(p)
-- A useless gap (like the dwm patch) can be defined with -- A useless gap (like the dwm patch) can be defined with
-- beautiful.useless_gap_width . -- beautiful.useless_gap_width .
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
if useless_gap < 0 then useless_gap = 0 end
-- A global border can be defined with
-- beautiful.global_border_width
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset
local bw = tonumber(beautiful.border_width) or 0
-- Screen. -- Screen.
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
-- Borders are factored in.
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
-- How many vertical columns? Read from nmaster on the tag. -- How many vertical columns? Read from nmaster on the tag.
local t = tag.selected(p.screen) local t = tag.selected(p.screen)
local num_x = centerfair.nmaster or tag.getnmaster(t) local num_x = centerfair.nmaster or tag.getnmaster(t)
local ncol = centerfair.ncol or tag.getncol(t) local ncol = centerfair.ncol or tag.getncol(t)
if num_x <= 2 then num_x = 2 end
if num_x > #cls then num_x = #cls end
local width = math.floor((wa.width-(num_x+1)*useless_gap) / num_x) local width = math.floor((wa.width-(num_x+1)*useless_gap) / num_x)
@ -61,9 +77,9 @@ function centerfair.arrange(p)
local g = {} local g = {}
g.width = width g.width = width
g.height = wa.height - 2*useless_gap - 2 g.height = wa.height - 2*useless_gap - 2
g.y = offset_y g.y = offset_y + global_border
for i = 1, #cls do for i = 1, #cls do
g.x = offset_x + (i - 1) * (width + useless_gap + 2) g.x = offset_x + (i - 1) * (width + useless_gap + 2) + global_border
cls[i]:geometry(g) cls[i]:geometry(g)
end end
else else
@ -75,10 +91,10 @@ function centerfair.arrange(p)
-- Master client deserves a special treatement -- Master client deserves a special treatement
local g = {} local g = {}
g.width = wa.width - (num_x-1)*width -num_x*useless_gap - 2 g.width = wa.width - (num_x - 1) * width - num_x * useless_gap
g.height = wa.height - 2*useless_gap - 2 g.height = wa.height - 2*useless_gap - 2
g.x = offset_x + useless_gap g.x = offset_x + useless_gap + global_border
g.y = offset_y g.y = offset_y + global_border
cls[1]:geometry(g) cls[1]:geometry(g)
-- Treat the other clients -- Treat the other clients
@ -128,8 +144,8 @@ function centerfair.arrange(p)
for i = 1, (num_x-1) do for i = 1, (num_x-1) do
to_remove = 2 to_remove = 2
g.height = math.floor((wa.height-useless_gap)/num_y[i]) g.height = math.floor((wa.height - (num_y[i] * useless_gap)) / num_y[i])
g.y = offset_y g.y = offset_y + global_border
for j = 0, (num_y[i]-2) do for j = 0, (num_y[i]-2) do
cls[nclient]:geometry(g) cls[nclient]:geometry(g)
nclient = nclient + 1 nclient = nclient + 1

View File

@ -2,6 +2,7 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
@ -26,10 +27,22 @@ function centerwork.arrange(p)
-- beautiful.useless_gap_width . -- beautiful.useless_gap_width .
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
-- A global border can be defined with
-- beautiful.global_border_width
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset
local bw = tonumber(beautiful.border_width) or 0
-- Screen. -- Screen.
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
-- Borders are factored in.
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
-- Width of main column? -- Width of main column?
local t = awful.tag.selected(p.screen) local t = awful.tag.selected(p.screen)
local mwfact = awful.tag.getmwfact(t) local mwfact = awful.tag.getmwfact(t)
@ -37,7 +50,7 @@ function centerwork.arrange(p)
if #cls > 0 if #cls > 0
then then
-- Main column, fixed width and height. -- Main column, fixed width and height.
local c = cls[1] local c = cls[#cls]
local g = {} local g = {}
local mainwid = math.floor(wa.width * mwfact) local mainwid = math.floor(wa.width * mwfact)
local slavewid = wa.width - mainwid local slavewid = wa.width - mainwid
@ -48,8 +61,8 @@ function centerwork.arrange(p)
g.height = wa.height - 2 * useless_gap g.height = wa.height - 2 * useless_gap
g.width = mainwid g.width = mainwid
g.x = wa.x + slaveLwid g.x = wa.x + slaveLwid + global_border
g.y = wa.y + useless_gap g.y = wa.y + useless_gap + global_border
c:geometry(g) c:geometry(g)
@ -57,7 +70,7 @@ function centerwork.arrange(p)
if #cls > 1 if #cls > 1
then then
local at = 0 local at = 0
for i = (#cls),2,-1 for i = (#cls - 1),1,-1
do do
-- It's all fixed. If there are more than 5 clients, -- It's all fixed. If there are more than 5 clients,
-- those additional clients will float. This is -- those additional clients will float. This is
@ -73,29 +86,29 @@ function centerwork.arrange(p)
if at == centerwork.top_left if at == centerwork.top_left
then then
-- top left -- top left
g.x = wa.x + useless_gap g.x = wa.x + useless_gap + global_border
g.y = wa.y + useless_gap g.y = wa.y + useless_gap + global_border
g.width = slaveLwid - 2 * useless_gap g.width = slaveLwid - 2 * useless_gap
g.height = slaveThei - useless_gap g.height = slaveThei - useless_gap
elseif at == centerwork.top_right elseif at == centerwork.top_right
then then
-- top right -- top right
g.x = wa.x + slaveLwid + mainwid + useless_gap g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border
g.y = wa.y + useless_gap g.y = wa.y + useless_gap + global_border
g.width = slaveRwid - 2 * useless_gap g.width = slaveRwid - 2 * useless_gap
g.height = slaveThei - useless_gap g.height = slaveThei - useless_gap
elseif at == centerwork.bottom_left elseif at == centerwork.bottom_left
then then
-- bottom left -- bottom left
g.x = wa.x + useless_gap g.x = wa.x + useless_gap + global_border
g.y = wa.y + slaveThei + useless_gap g.y = wa.y + slaveThei + useless_gap + global_border
g.width = slaveLwid - 2 * useless_gap g.width = slaveLwid - 2 * useless_gap
g.height = slaveBhei - 2 * useless_gap g.height = slaveBhei - 2 * useless_gap
elseif at == centerwork.bottom_right elseif at == centerwork.bottom_right
then then
-- bottom right -- bottom right
g.x = wa.x + slaveLwid + mainwid + useless_gap g.x = wa.x + slaveLwid + mainwid + useless_gap + global_border
g.y = wa.y + slaveThei + useless_gap g.y = wa.y + slaveThei + useless_gap + global_border
g.width = slaveRwid - 2 * useless_gap g.width = slaveRwid - 2 * useless_gap
g.height = slaveBhei - 2 * useless_gap g.height = slaveBhei - 2 * useless_gap
end end

View File

@ -2,6 +2,7 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
@ -38,11 +39,24 @@ function termfair.arrange(p)
-- A useless gap (like the dwm patch) can be defined with -- A useless gap (like the dwm patch) can be defined with
-- beautiful.useless_gap_width. -- beautiful.useless_gap_width.
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
if useless_gap < 0 then useless_gap = 0 end
-- A global border can be defined with
-- beautiful.global_border_width
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset
local bw = tonumber(beautiful.border_width) or 0
-- Screen. -- Screen.
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
-- Borders are factored in.
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
-- How many vertical columns? -- How many vertical columns?
local t = tag.selected(p.screen) local t = tag.selected(p.screen)
local num_x = termfair.nmaster or tag.getnmaster(t) local num_x = termfair.nmaster or tag.getnmaster(t)
@ -79,43 +93,26 @@ function termfair.arrange(p)
local g = {} local g = {}
if this_x == (num_x - 1) if this_x == (num_x - 1)
then then
g.width = wa.width - (num_x - 1) * width g.width = wa.width - (num_x - 1) * width - useless_gap
else else
g.width = width g.width = width - useless_gap
end end
if this_y == (num_y - 1) if this_y == (num_y - 1)
then then
g.height = wa.height - (num_y - 1) * height g.height = wa.height - (num_y - 1) * height - useless_gap
else else
g.height = height g.height = height - useless_gap
end end
g.x = wa.x + this_x * width g.x = wa.x + this_x * width + global_border
g.y = wa.y + this_y * height g.y = wa.y + this_y * height + global_border
if useless_gap > 0 if useless_gap > 0
then then
-- Top and left clients are shrinked by two steps and -- All clients tile evenly.
-- get moved away from the border. Other clients just g.x = g.x + (useless_gap / 2)
-- get shrinked in one direction. g.y = g.y + (useless_gap / 2)
gap_factor = (useless_gap / 100) * 2
if this_x == 0
then
g.width = g.width - (2 + gap_factor) * useless_gap
g.x = g.x + useless_gap
else
g.width = g.width - (1 + gap_factor) * useless_gap
end
if this_y == 0
then
g.height = g.height - (2 + gap_factor) * useless_gap
g.y = g.y + useless_gap
else
g.height = g.height - (1 + gap_factor) * useless_gap
end
end end
c:geometry(g) c:geometry(g)
remaining_clients = remaining_clients - 1 remaining_clients = remaining_clients - 1

View File

@ -2,6 +2,7 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2014, projektile
* (c) 2013, Luke Bonham * (c) 2013, Luke Bonham
* (c) 2012, Josh Komoroske * (c) 2012, Josh Komoroske
* (c) 2010-2012, Peter Hofmann * (c) 2010-2012, Peter Hofmann
@ -19,10 +20,23 @@ local function fair(p, orientation)
-- A useless gap (like the dwm patch) can be defined with -- A useless gap (like the dwm patch) can be defined with
-- beautiful.useless_gap_width. -- beautiful.useless_gap_width.
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
if useless_gap < 0 then useless_gap = 0 end
-- A global border can be defined with
-- beautiful.global_border_width.
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset.
local bw = tonumber(beautiful.border_width) or 0
-- get our orientation right.
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
if #cls > 0 then if #cls > 0 then
local cells = math.ceil(math.sqrt(#cls)) local cells = math.ceil(math.sqrt(#cls))
local strips = math.ceil(#cls / cells) local strips = math.ceil(#cls / cells)
@ -47,8 +61,8 @@ local function fair(p, orientation)
this_x = cell this_x = cell
this_y = strip this_y = strip
g.x = wa.x + cell * g.width g.x = wa.x + cell * g.width + global_border
g.y = wa.y + strip * g.height g.y = wa.y + strip * g.height + global_border
else else
if #cls < (strips * cells) and strip == strips - 1 then if #cls < (strips * cells) and strip == strips - 1 then
@ -61,34 +75,20 @@ local function fair(p, orientation)
this_x = strip this_x = strip
this_y = cell this_y = cell
g.x = wa.x + strip * g.width g.x = wa.x + strip * g.width + global_border
g.y = wa.y + cell * g.height g.y = wa.y + cell * g.height + global_border
end end
-- Useless gap. -- Useless gap.
if useless_gap > 0 if useless_gap > 0
then then
-- Top and left clients are shrinked by two steps and -- All clients tile evenly.
-- get moved away from the border. Other clients just g.width = g.width - useless_gap
-- get shrinked in one direction. g.x = g.x + (useless_gap / 2)
g.height = g.height - useless_gap
g.y = g.y + (useless_gap / 2)
gap_factor = (useless_gap / 100) * 2
if this_x == 0
then
g.width = g.width - (2 + gap_factor) * useless_gap
g.x = g.x + useless_gap
else
g.width = g.width - (1 + gap_factor) * useless_gap
end
if this_y == 0
then
g.height = g.height - (2 + gap_factor) * useless_gap
g.y = g.y + useless_gap
else
g.height = g.height - (1 + gap_factor) * useless_gap
end
end end
-- End of useless gap. -- End of useless gap.

View File

@ -2,7 +2,8 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham * (c) 2014 projektile
* (c) 2013 Luke Bonham
* (c) 2009 Uli Schlachter * (c) 2009 Uli Schlachter
* (c) 2008 Julien Danjolu * (c) 2008 Julien Danjolu
@ -11,6 +12,8 @@
local beautiful = require("beautiful") local beautiful = require("beautiful")
local ipairs = ipairs local ipairs = ipairs
local tonumber = tonumber local tonumber = tonumber
local math = require("math")
local naughty = require("naughty")
local uselesspiral = {} local uselesspiral = {}
@ -18,19 +21,32 @@ local function spiral(p, spiral)
-- A useless gap (like the dwm patch) can be defined with -- A useless gap (like the dwm patch) can be defined with
-- beautiful.useless_gap_width. -- beautiful.useless_gap_width.
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
if useless_gap < 0 then useless_gap = 0 end
-- A global border can be defined with
-- beautiful.global_border_width
local global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- Themes border width requires an offset
local bw = tonumber(beautiful.border_width) or 0
-- get our orientation right
local wa = p.workarea local wa = p.workarea
local cls = p.clients local cls = p.clients
local n = #cls local n = #cls -- number of windows total; k = which window number
wa.height = wa.height - ((global_border * 2) + (bw * 2))
wa.width = wa.width - ((global_border * 2) + (bw * 2))
local static_wa = wa local static_wa = wa
for k, c in ipairs(cls) do for k, c in ipairs(cls) do
if k < n then if k < n then
if k % 2 == 0 then if k % 2 == 0 then
wa.height = wa.height / 2 wa.height = (wa.height / 2)
else else
wa.width = wa.width / 2 wa.width = (wa.width / 2)
end end
end end
@ -49,10 +65,10 @@ local function spiral(p, spiral)
end end
local wa2 = {} local wa2 = {}
wa2.x = wa.x wa2.x = wa.x + (useless_gap / 2) + global_border
wa2.y = wa.y wa2.y = wa.y + (useless_gap / 2) + global_border
wa2.height = wa.height wa2.height = wa.height - (useless_gap / 2)
wa2.width = wa.width wa2.width = wa.width - (useless_gap / 2)
-- Useless gap. -- Useless gap.
if useless_gap > 0 if useless_gap > 0
@ -64,8 +80,6 @@ local function spiral(p, spiral)
top = false top = false
left = false left = false
gap_factor = (useless_gap / 100) * 2
if wa2.y == static_wa.y then if wa2.y == static_wa.y then
top = true top = true
end end
@ -75,17 +89,17 @@ local function spiral(p, spiral)
end end
if top then if top then
wa2.height = wa2.height - (2 + gap_factor) * useless_gap wa2.height = wa2.height - useless_gap
wa2.y = wa2.y + useless_gap wa2.y = wa2.y - (useless_gap / 2)
else else
wa2.height = wa2.height - (1 + gap_factor) * useless_gap wa2.height = wa2.height - (useless_gap / 2)
end end
if left then if left then
wa2.width = wa2.width - (2 + gap_factor) * useless_gap wa2.width = wa2.width - useless_gap
wa2.x = wa2.x + useless_gap wa2.x = wa2.x - (useless_gap / 2)
else else
wa2.width = wa2.width - (1 + gap_factor) * useless_gap wa2.width = wa2.width - (useless_gap / 2)
end end
end end
-- End of useless gap. -- End of useless gap.

View File

@ -2,12 +2,14 @@
--[[ --[[
Licensed under GNU General Public License v2 Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham * (c) 2014 projektile
* (c) 2013 Luke Bonham
* (c) 2009 Donald Ephraim Curtis * (c) 2009 Donald Ephraim Curtis
* (c) 2008 Julien Danjolu * (c) 2008 Julien Danjolu
--]] --]]
local naughty = require("naughty")
local tag = require("awful.tag") local tag = require("awful.tag")
local beautiful = require("beautiful") local beautiful = require("beautiful")
local ipairs = ipairs local ipairs = ipairs
@ -22,6 +24,14 @@ local function tile_group(cls, wa, orientation, fact, group)
-- A useless gap (like the dwm patch) can be defined with -- A useless gap (like the dwm patch) can be defined with
-- beautiful.useless_gap_width . -- beautiful.useless_gap_width .
local useless_gap = tonumber(beautiful.useless_gap_width) or 0 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
if useless_gap < 0 then useless_gap = 0 end
-- A global border can be defined with
-- beautiful.global_border_width
global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
-- BW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
-- get our orientation right -- get our orientation right
local height = "height" local height = "height"
@ -36,7 +46,8 @@ local function tile_group(cls, wa, orientation, fact, group)
end end
-- make this more generic (not just width) -- make this more generic (not just width)
available = wa[width] - (group.coord - wa[x]) --if for top
available = wa[width] - (group.coord - wa[x]) -- it's truly not here
-- find our total values -- find our total values
local total_fact = 0 local total_fact = 0
@ -58,20 +69,19 @@ local function tile_group(cls, wa, orientation, fact, group)
end end
total_fact = total_fact + fact[i] total_fact = total_fact + fact[i]
end end
size = math.min(size, available) size = math.min(size, (available - global_border))
local coord = wa[y] local coord = wa[y]
local geom = {} local geom = {}
local used_size = 0 local used_size = 0
local unused = wa[height] local unused = wa[height] - (global_border * 2)
local stat_coord = wa[x] local stat_coord = wa[x]
--stat_coord = size --stat_coord = size
for c = group.first,group.last do for c = group.first,group.last do
local i = c - group.first +1 local i = c - group.first +1
geom[width] = size geom[width] = size - global_border
geom[height] = math.floor(unused * fact[i] / total_fact) geom[height] = math.floor(unused * fact[i] / total_fact)
geom[x] = group.coord geom[x] = group.coord + global_border + (useless_gap / 2)
geom[y] = coord geom[y] = coord + global_border + (useless_gap / 2)
coord = coord + geom[height] coord = coord + geom[height]
unused = unused - geom[height] unused = unused - geom[height]
@ -88,8 +98,6 @@ local function tile_group(cls, wa, orientation, fact, group)
top = false top = false
left = false left = false
gap_factor = (useless_gap / 100) * 2
if geom[y] == wa[y] then if geom[y] == wa[y] then
top = true top = true
end end
@ -99,17 +107,17 @@ local function tile_group(cls, wa, orientation, fact, group)
end end
if top then if top then
geom[height] = geom[height] - (2 + gap_factor) * useless_gap geom[height] = geom[height] - (2 * useless_gap)
geom[y] = geom[y] + useless_gap geom[y] = geom[y] + useless_gap
else else
geom[height] = geom[height] - (1 + gap_factor) * useless_gap geom[height] = geom[height] - useless_gap
end end
if left then if left then
geom[width] = geom[width] - (2 + gap_factor) * useless_gap geom[width] = geom[width] - (2 * useless_gap)
geom[x] = geom[x] + useless_gap geom[x] = geom[x] + useless_gap
else else
geom[width] = geom[width] - (1 + gap_factor) * useless_gap geom[width] = geom[width] - useless_gap
end end
end end
-- End of useless gap. -- End of useless gap.
@ -136,6 +144,11 @@ local function tile(param, orientation)
y = "x" y = "x"
end end
-- A global border can be defined with
-- beautiful.global_border_width
global_border = tonumber(beautiful.global_border_width) or 0
if global_border < 0 then global_border = 0 end
local cls = param.clients local cls = param.clients
local nmaster = math.min(tag.getnmaster(t), #cls) local nmaster = math.min(tag.getnmaster(t), #cls)
local nother = math.max(#cls - nmaster,0) local nother = math.max(#cls - nmaster,0)
@ -181,7 +194,7 @@ local function tile(param, orientation)
end end
for i = 1,ncol do for i = 1,ncol do
-- Try to get equal width among remaining columns -- Try to get equal width among remaining columns
local size = math.min( (wasize - (coord - wa[x])) / (ncol - i + 1) ) local size = math.min((wasize - (coord - wa[x])) / (ncol - i + 1)) --+ (global_border/(ncol))/(ncol+i^2)
local first = last + 1 local first = last + 1
last = last + math.floor((#cls - last)/(ncol - i + 1)) last = last + math.floor((#cls - last)/(ncol - i + 1))
-- tile the column and update our current x coordinate -- tile the column and update our current x coordinate
@ -228,3 +241,4 @@ uselesstile.arrange = uselesstile.right.arrange
uselesstile.name = uselesstile.right.name uselesstile.name = uselesstile.right.name
return uselesstile return uselesstile