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)
37 -- Width of main column?
38 local t = awful.tag.selected(p.screen)
39 local mwfact = awful.tag.getmwfact(t)
43 -- Main column, fixed width and height.
46 local mainwid = math.floor(wa.width * mwfact)
47 local slavewid = wa.width - mainwid
48 local slaveLwid = math.floor(slavewid / 2)
49 local slaveRwid = slavewid - slaveLwid
50 local slaveThei = math.floor(wa.height / 2)
51 local slaveBhei = wa.height - slaveThei
53 g.height = wa.height - 2 * useless_gap
55 g.x = wa.x + slaveLwid
56 g.y = wa.y + useless_gap
64 for i = (#cls - 1),1,-1
66 -- It's all fixed. If there are more than 5 clients,
67 -- those additional clients will float. This is
77 if at == centerwork.top_left
80 g.x = wa.x + useless_gap
81 g.y = wa.y + useless_gap
82 g.width = slaveLwid - 2 * useless_gap
83 g.height = slaveThei - useless_gap
84 elseif at == centerwork.top_right
87 g.x = wa.x + slaveLwid + mainwid + useless_gap
88 g.y = wa.y + useless_gap
89 g.width = slaveRwid - 2 * useless_gap
90 g.height = slaveThei - useless_gap
91 elseif at == centerwork.bottom_left
94 g.x = wa.x + useless_gap
95 g.y = wa.y + slaveThei + useless_gap
96 g.width = slaveLwid - 2 * useless_gap
97 g.height = slaveBhei - 2 * useless_gap
98 elseif at == centerwork.bottom_right
101 g.x = wa.x + slaveLwid + mainwid + useless_gap
102 g.y = wa.y + slaveThei + useless_gap
103 g.width = slaveRwid - 2 * useless_gap
104 g.height = slaveBhei - 2 * useless_gap
112 -- Set remaining clients to floating.
113 for i = (#cls - 1 - 4),1,-1
116 awful.client.floating.set(c, true)