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)
32 for k, c in ipairs(cls) do
35 wa.height = wa.height / 2
37 wa.width = wa.width / 2
41 if k % 4 == 0 and spiral then
42 wa.x = wa.x - wa.width
44 (k % 4 == 3 and k < n and spiral) then
45 wa.x = wa.x + wa.width
48 if k % 4 == 1 and k ~= 1 and spiral then
49 wa.y = wa.y - wa.height
50 elseif k % 2 == 1 and k ~= 1 or
51 (k % 4 == 0 and k < n and spiral) then
52 wa.y = wa.y + wa.height
58 wa2.height = wa.height
64 -- Top and left clients are shrinked by two steps and
65 -- get moved away from the border. Other clients just
66 -- get shrinked in one direction.
71 if wa2.y == static_wa.y then
75 if wa2.x == static_wa.x then
80 wa2.height = wa2.height - 2 * useless_gap
81 wa2.y = wa2.y + useless_gap
83 wa2.height = wa2.height - useless_gap
87 wa2.width = wa2.width - 2 * useless_gap
88 wa2.x = wa2.x + useless_gap
90 wa2.width = wa2.width - useless_gap
93 -- End of useless gap.
100 uselesspiral.dwindle = {}
101 uselesspiral.dwindle.name = "uselessdwindle"
102 function uselesspiral.dwindle.arrange(p)
103 return spiral(p, false)
107 uselesspiral.name = "uselesspiral"
108 function uselesspiral.arrange(p)
109 return spiral(p, true)