From: martin f. krafft Date: Sat, 26 Oct 2013 17:12:48 +0000 (+0200) Subject: toggle maximised also vertical/horizontal X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/08e7ca5204b116bff92c28fe1c4ed1b8232e3af0?ds=inline toggle maximised also vertical/horizontal --- diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 4ed63a4..cb4d7e1 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -387,8 +387,24 @@ clientkeys = awful.util.table.join( awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end), awful.key({ modkey, }, "m", function (c) - c.maximized_horizontal = not c.maximized_horizontal - c.maximized_vertical = not c.maximized_vertical + -- silly lua can't do bitwise operations + if not c.maximized_horizontal and not c.maximized_vertical then + c.maximized_horizontal = true + c.maximized_vertical = true + elseif c.maximized_horizontal and c.maximized_vertical then + c.maximized_horizontal = false + c.maximized_vertical = true + elseif not c.maximized_horizontal and c.maximized_vertical then + c.maximized_horizontal = true + c.maximized_vertical = false + elseif c.maximized_horizontal and not c.maximized_vertical then + c.maximized_horizontal = false + c.maximized_vertical = false + end + -- b = c.maximized_horizontal + c.maximized_vertical * 2 + -- b = (b + 1) % 4 + -- c.maximized_horizontal = b & 1 + -- c.maximized_vertical = (b & 2) >>1 end) )