All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
4 Licensed under GNU General Public License v2
5 * (c) 2013, Luke Bonham
6 * (c) 2009 Uli Schlachter
7 * (c) 2008 Julien Danjolu
11 local beautiful = require("beautiful")
13 local tonumber = tonumber
15 local uselesspiral = {}
17 local function spiral(p, spiral)
18 -- A useless gap (like the dwm patch) can be defined with
19 -- beautiful.useless_gap_width.
20 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
28 for k, c in ipairs(cls) do
31 wa.height = wa.height / 2
33 wa.width = wa.width / 2
37 if k % 4 == 0 and spiral then
38 wa.x = wa.x - wa.width
40 (k % 4 == 3 and k < n and spiral) then
41 wa.x = wa.x + wa.width
44 if k % 4 == 1 and k ~= 1 and spiral then
45 wa.y = wa.y - wa.height
46 elseif k % 2 == 1 and k ~= 1 or
47 (k % 4 == 0 and k < n and spiral) then
48 wa.y = wa.y + wa.height
54 wa2.height = wa.height
60 -- Top and left clients are shrinked by two steps and
61 -- get moved away from the border. Other clients just
62 -- get shrinked in one direction.
67 gap_factor = (useless_gap / 100) * 2
69 if wa2.y == static_wa.y then
73 if wa2.x == static_wa.x then
78 wa2.height = wa2.height - (2 + gap_factor) * useless_gap
79 wa2.y = wa2.y + useless_gap
81 wa2.height = wa2.height - (1 + gap_factor) * useless_gap
85 wa2.width = wa2.width - (2 + gap_factor) * useless_gap
86 wa2.x = wa2.x + useless_gap
88 wa2.width = wa2.width - (1 + gap_factor) * useless_gap
91 -- End of useless gap.
98 uselesspiral.dwindle = {}
99 uselesspiral.dwindle.name = "uselessdwindle"
100 function uselesspiral.dwindle.arrange(p)
101 return spiral(p, false)
105 uselesspiral.name = "uselesspiral"
106 function uselesspiral.arrange(p)
107 return spiral(p, true)