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) 2010-2012, Peter Hofmann
10 local awful = require("awful")
11 local beautiful = require("beautiful")
12 local tonumber = tonumber
13 local math = { floor = math.floor }
24 function centerwork.arrange(p)
25 -- A useless gap (like the dwm patch) can be defined with
26 -- beautiful.useless_gap_width .
27 local useless_gap = tonumber(beautiful.useless_gap_width) or 0
33 -- Width of main column?
34 local t = awful.tag.selected(p.screen)
35 local mwfact = awful.tag.getmwfact(t)
39 -- Main column, fixed width and height.
42 local mainwid = math.floor(wa.width * mwfact)
43 local slavewid = wa.width - mainwid
44 local slaveLwid = math.floor(slavewid / 2)
45 local slaveRwid = slavewid - slaveLwid
46 local slaveThei = math.floor(wa.height / 2)
47 local slaveBhei = wa.height - slaveThei
49 g.height = wa.height - 2 * useless_gap
51 g.x = wa.x + slaveLwid
52 g.y = wa.y + useless_gap
62 -- It's all fixed. If there are more than 5 clients,
63 -- those additional clients will float. This is
73 if at == centerwork.top_left
76 g.x = wa.x + useless_gap
77 g.y = wa.y + useless_gap
78 g.width = slaveLwid - 2 * useless_gap
79 g.height = slaveThei - useless_gap
80 elseif at == centerwork.top_right
83 g.x = wa.x + slaveLwid + mainwid + useless_gap
84 g.y = wa.y + useless_gap
85 g.width = slaveRwid - 2 * useless_gap
86 g.height = slaveThei - useless_gap
87 elseif at == centerwork.bottom_left
90 g.x = wa.x + useless_gap
91 g.y = wa.y + slaveThei + useless_gap
92 g.width = slaveLwid - 2 * useless_gap
93 g.height = slaveBhei - 2 * useless_gap
94 elseif at == centerwork.bottom_right
97 g.x = wa.x + slaveLwid + mainwid + useless_gap
98 g.y = wa.y + slaveThei + useless_gap
99 g.width = slaveRwid - 2 * useless_gap
100 g.height = slaveBhei - 2 * useless_gap
108 -- Set remaining clients to floating.
109 for i = (#cls - 1 - 4),1,-1
112 awful.client.floating.set(c, true)