From 795f996091ecf88ddf9b0e59d59d2eabf7735b6c Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.dev>
Date: Wed, 3 Jul 2024 08:00:00 +0100
Subject: [PATCH] awesome: swap Mod+j and Mod+k keybindings

Make `Mod+j` go left and `Mod+k` go right, so they match the position of
the keys on the keyboard.
---
 config/awesome/rc.lua | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua
index 11d14035..1dbc3234 100644
--- a/config/awesome/rc.lua
+++ b/config/awesome/rc.lua
@@ -272,28 +272,34 @@ globalkeys = gears.table.join(
   awful.key({ modkey }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
   awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
   awful.key({ modkey }, "j", function()
-    awful.client.focus.byidx(1)
-  end, { description = "focus next by index", group = "client" }),
-  awful.key({ modkey }, "k", function()
     awful.client.focus.byidx(-1)
   end, { description = "focus previous by index", group = "client" }),
+
+  awful.key({ modkey }, "k", function()
+    awful.client.focus.byidx(1)
+  end, { description = "focus next by index", group = "client" }),
+
   awful.key({ modkey }, "w", function()
     mymainmenu:show()
   end, { description = "show main menu", group = "awesome" }),
 
   -- Layout manipulation
   awful.key({ modkey, "Shift" }, "j", function()
-    awful.client.swap.byidx(1)
-  end, { description = "swap with next client by index", group = "client" }),
-  awful.key({ modkey, "Shift" }, "k", function()
     awful.client.swap.byidx(-1)
   end, { description = "swap with previous client by index", group = "client" }),
+
+  awful.key({ modkey, "Shift" }, "k", function()
+    awful.client.swap.byidx(1)
+  end, { description = "swap with next client by index", group = "client" }),
+
   awful.key({ modkey, "Control" }, "j", function()
-    awful.screen.focus_relative(1)
-  end, { description = "focus the next screen", group = "screen" }),
-  awful.key({ modkey, "Control" }, "k", function()
     awful.screen.focus_relative(-1)
   end, { description = "focus the previous screen", group = "screen" }),
+
+  awful.key({ modkey, "Control" }, "k", function()
+    awful.screen.focus_relative(1)
+  end, { description = "focus the next screen", group = "screen" }),
+
   awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
   awful.key({ modkey }, "Tab", function()
     awful.client.focus.history.previous()