]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

toggle maximised also vertical/horizontal
authormartin f. krafft <madduck@madduck.net>
Sat, 26 Oct 2013 17:12:48 +0000 (19:12 +0200)
committermartin f. krafft <madduck@madduck.net>
Sat, 26 Oct 2013 17:12:53 +0000 (19:12 +0200)
.config/awesome/rc.lua

index 4ed63a4b92af7aa139251052106c23872b5a5daa..cb4d7e1696b014cca3ea264590020a9c77b9e7c1 100644 (file)
@@ -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)
     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)
 )
 
         end)
 )