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 if wa2.y == static_wa.y then
71 if wa2.x == static_wa.x then
76 wa2.height = wa2.height - 2 * useless_gap
77 wa2.y = wa2.y + useless_gap
79 wa2.height = wa2.height - useless_gap
83 wa2.width = wa2.width - 2 * useless_gap
84 wa2.x = wa2.x + useless_gap
86 wa2.width = wa2.width - useless_gap
89 -- End of useless gap.
96 uselesspiral.dwindle = {}
97 uselesspiral.dwindle.name = "uselessdwindle"
98 function uselesspiral.dwindle.arrange(p)
99 return spiral(p, false)
103 uselesspiral.name = "uselesspiral"
104 function uselesspiral.arrange(p)
105 return spiral(p, true)