FullScreens
From awesome
The thing that annoyed me for some time was that my colleagues, using gnome, could resize their clients/windows to span both screens on our dual screen setup at work. So after some thinking and help from the awesome channel I wrote a lua function to do that with a client.
The function
function fullscreens(c)
awful.client.floating.toggle(c)
if awful.client.floating.get(c) then
local clientX = screen[1].workarea.x
local clientY = screen[1].workarea.y
local clientWidth = 0
-- look at http://www.rpm.org/api/4.4.2.2/llimits_8h-source.html
local clientHeight = 2147483640
for s = 1, screen.count() do
clientHeight = math.min(clientHeight, screen[s].workarea.height)
clientWidth = clientWidth + screen[s].workarea.width
end
local t = c:geometry({x = clientX, y = clientY, width = clientWidth, height = clientHeight})
else
--apply the rules to this client so he can return to the right tag if there is a rule for that.
awful.rules.apply(c)
end
-- focus our client
client.focus = c
end
This function will:
- Toggle the floating property on the provided client as parameter.
- If the floating property becomes true it will resize the client on all screens.
- If the floating property becomes false it will restore the client's default size and tag.
Some notes on the function
On some machines the most left screen(from where the geometry coordinates should start is not screen[1] so
local clientX = screen[1].workarea.x local clientY = screen[1].workarea.y
should be changed to
local clientX = screen[other_index].workarea.x local clientY = screen[other_index].workarea.y
Function usage
In my configuration Mod + f is bound to fullscreen, so Mod + Shift + f seems like a nice key combination for fullscreens. To use that put this line where you define your clientkeys
clientkeys = awful.util.table.join(
...
awful.key({ modkey, "Shift" }, "f", fullscreens),
...
)