From 08e7ca5204b116bff92c28fe1c4ed1b8232e3af0 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sat, 26 Oct 2013 19:12:48 +0200 Subject: [PATCH] toggle maximised also vertical/horizontal --- .config/awesome/rc.lua | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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) ) -- 2.39.5