From b86d7a7f79c4fbc11dc02c42a2f83a45f1b0e912 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= <henrik@tjaders.com>
Date: Wed, 19 Feb 2020 14:52:27 +0100
Subject: [PATCH] Decide on license and add the rest of keybindings

---
 taggrid.lua     |  7 ++++---
 taggridkeys.lua | 51 +++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/taggrid.lua b/taggrid.lua
index 75eb22f..9dd3b81 100644
--- a/taggrid.lua
+++ b/taggrid.lua
@@ -1,7 +1,7 @@
 ----------------------------------------------------------------------------
 ---- @author AfoHT
 ---- @copyright 2020 AfoHT
----- @license MIT/Apache
+---- @license MIT
 ---- @module taggrid
 ------------------------------------------------------------------------------
 
@@ -89,13 +89,13 @@ end
 -- Jump to the row below in the grid
 function taggrid.viewdown()
     local tag_offset = taggrid.tag_offset
-    awful.tag.viewidx(-tag_offset)
+    awful.tag.viewidx(tag_offset)
 end
 
 -- Jump to the row above in the grid
 function taggrid.viewup()
     local tag_offset = taggrid.tag_offset
-    awful.tag.viewidx(tag_offset)
+    awful.tag.viewidx(-tag_offset)
 end
 
 -- Shift the currently focused client left
@@ -170,6 +170,7 @@ end
 -- Shift the focused tag "upwards" in the grid
 function taggrid.shiftup()
     if client.focus then
+        local tag_offset = taggrid.tag_offset
         local t = awful.screen.focused().selected_tag
         local curidx = t.index
         local tag
diff --git a/taggridkeys.lua b/taggridkeys.lua
index 8f924a6..9f539de 100644
--- a/taggridkeys.lua
+++ b/taggridkeys.lua
@@ -1,8 +1,8 @@
-----------------------------------------------------------------------------
+--------------------------------------------------------------------------
 ---- @author AfoHT
 ---- @copyright 2020 AfoHT
----- @license MIT/Apache
----- @module globalkeys
+---- @license MIT
+---- @module taggridkeys
 ------------------------------------------------------------------------------
 
 -- Package envronment
@@ -22,22 +22,53 @@ function _M.get(globalkeys)
         globalkeys = gears.table.join(globalkeys,
             -- View tag only.
             awful.key({ modkey }, "#" .. i + 9,
-            function ()
-                taggrid.numviewtag(i)
-            end,
+            function () taggrid.numviewtag(i) end,
                 {description = "view tag #"..i, group = "tag"}),
             -- Toggle tag display.
-            awful.key({ modkey, "Control" }, "#" .. i + 9, taggrid.numviewtoggle(i),
+            awful.key({ modkey, "Control" }, "#" .. i + 9,
+            function () taggrid.numviewtoggle(i) end,
                     {description = "toggle tag #" .. i, group = "tag"}),
 
             -- Move client to tag.
-            awful.key({ modkey, "Shift" }, "#" .. i + 9, taggrid.numshifttag(i),
+            awful.key({ modkey, "Shift" }, "#" .. i + 9,
+            function () taggrid.numshifttag(i) end,
                     {description = "move focused client to tag #"..i, group = "tag"}),
             -- Toggle tag on focused client.
-            awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, taggrid.numtoggletag(i),
+            awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
+            function () taggrid.numtoggletag(i) end,
                     {description = "toggle focused client on tag #" .. i, group = "tag"})
         )
-     end
+    end
+    globalkeys = gears.table.join(globalkeys,
+    -- Switch tag up or down
+        -- Move down a column
+        awful.key({ modkey,           }, "Down", taggrid.viewdown,
+                {description = "Jump down one column", group = "tag"}),
+        -- Move up a column
+        awful.key({ modkey,           }, "Up", taggrid.viewup,
+                {description = "Jump up one column", group = "tag"}),
+
+    -- Shift windows to left or right
+
+        -- Shift left
+        awful.key({ modkey, "Shift"   }, ",", taggrid.shiftleft,
+                {description = "Move tag left", group = "tag"}),
+        -- Shift right
+        awful.key({ modkey, "Shift"   }, ".", taggrid.shiftright,
+                {description = "Move tag right", group = "tag"}),
+        -- Shift left
+        awful.key({ modkey, "Shift"   }, "Left", taggrid.shiftleft,
+                {description = "Move tag left", group = "tag"}),
+        -- Shift right
+        awful.key({ modkey, "Shift"   }, "Right", taggrid.shiftright,
+                {description = "Move tag right", group = "tag"}),
+
+    -- Shift windows up or down
+        awful.key({ modkey, "Shift"   }, "Down", taggrid.shiftdown,
+                {description = "Move tag down", group = "tag"}),
+        awful.key({ modkey, "Shift"   }, "Up", taggrid.shiftup,
+                {description = "Move tag up", group = "tag"})
+    )
   return globalkeys
 end
 
-- 
GitLab