util.magnify_client: toggle mode added

This commit is contained in:
luke bonham 2013-09-18 16:56:02 +02:00
parent c397afd0c7
commit 74f4507743
1 changed files with 14 additions and 10 deletions

View File

@ -84,6 +84,7 @@ end
-- Magnify a client: Set it to "float" and resize it. -- Magnify a client: Set it to "float" and resize it.
function util.magnify_client(c) function util.magnify_client(c)
if not awful.client.floating.get(c) then
awful.client.floating.set(c, true) awful.client.floating.set(c, true)
local mg = screen[mouse.screen].geometry local mg = screen[mouse.screen].geometry
@ -95,6 +96,9 @@ function util.magnify_client(c)
g.x = mg.x + (mg.width - g.width) / 2 g.x = mg.x + (mg.width - g.width) / 2
g.y = mg.y + (mg.height - g.height) / 2 g.y = mg.y + (mg.height - g.height) / 2
c:geometry(g) c:geometry(g)
else
awful.client.floating.set(c, false)
end
end end
-- Read the nice value of pid from /proc. -- Read the nice value of pid from /proc.