diff --git a/README.md b/README.md index de83d10..1ce0b81 100644 --- a/README.md +++ b/README.md @@ -58,3 +58,31 @@ while the `Control` key is used to max out the effect. | `Mod4` | `Mod1 (Alt)` | | Resize a client relative to the bottom right corner | | `Mod4` | `Mod1 (Alt)` | `Shift` | Resize a client relative to the top left corner | | `Control` | `Mod1 (Alt)` | | Move to the next/previous tag + +# Using different keys + +Due to the large ammount of keyboard shortcut Collision create, they are +auto-generated automatically. While this make installation simpler, it also +make Collision somewhat hard-coded magic. Some alternative keymaps can also +be ackward to use because of the reliance on mod keys such as `Alt` and `Control`. + +That being said, Collision allow some basic remapping. Instead of: + +```lua + require("collision")() +``` + +This can be used: + +```lua + require("collision") { + -- Normal Xephyr Vim G510 + up = { "Up" , "&" , "k" , "F15" }, + down = { "Down" , "KP_Enter" , "j" , "F14" }, + left = { "Left" , "#" , "h" , "F13" }, + right = { "Right" , "\"" , "l" , "F17" }, + } +``` + +Of course, if the `Vim` keys are used, any other shortcut binded to them have to +be removed from rc.lua. diff --git a/focus.lua b/focus.lua index 6cf2d7a..955c641 100644 --- a/focus.lua +++ b/focus.lua @@ -142,7 +142,8 @@ local function bydirection(dir, c, swap,max) capi.client.focus = cltbl[((not cltbl[target] and #cltbl == 1) and 1 or target)] capi.client.focus:raise() else - c:swap(cltbl[target]) + --BUG swap doesn't work if the screen is not the same + c:swap(cltbl[((not cltbl[target] and #cltbl == 1) and 1 or target)]) end display_wiboxes(cltbl,geomtbl,float,swap,c) end diff --git a/init.lua b/init.lua index 245a7de..b2c0c2c 100644 --- a/init.lua +++ b/init.lua @@ -113,7 +113,8 @@ function module.tag(direction,c,max) end local function new(k) - local k = k or keys + -- Replace the keys array. The new one has to have a valid mapping + keys = k or keys local aw = {} for k,v in pairs(keys) do