remove collision code for now

This commit is contained in:
BZ 2020-04-28 19:26:03 +02:00
parent e7880a702a
commit 7c3260950a
1 changed files with 17 additions and 62 deletions

View File

@ -17,73 +17,28 @@ local keys = {
right = { "l" } right = { "l" }
} }
local function loadrequire(mod)
local function requiref(mdl)
require(mdl)
end
local res = pcall(requiref, mod)
return res
end
local function new(ks) local function new(ks)
keys = ks or keys keys = ks or keys
local aw = {} local aw = {}
local use_collision = loadrequire("collision") glib.idle_add(glib.PRIORITY_DEFAULT_IDLE, function()
if use_collision then for k, v in pairs(keys) do
collision = require("collision"){} -- load collision without any keybinds for _, key_name in ipairs(v) do
end aw[#aw + 1] = awful.key(
{ "Mod4" },
if use_collision then key_name,
glib.idle_add(glib.PRIORITY_DEFAULT_IDLE, function() function()
for k, v in pairs(keys) do module.focus(k)
for _, key_name in ipairs(v) do end,
aw[#aw + 1] = awful.key( {
{ "Mod4" }, description = "Change focus to the " .. key_name .. " window",
key_name, group = "Navigator"
function() }
module.focus(k) )
end,
{
description = "Change focus to the " .. key_name .. " Window / Tmux Pane / VIM Split",
group = "Navigator"
}
)
aw[#aw + 1] = awful.key(
{ "Mod4", "Shift" },
key_name,
function()
collision.move(k)
end,
{
description = "Move to the " .. key_name,
group = "Collision"
}
)
end
end end
capi.root.keys(awful.util.table.join(capi.root.keys(), unpack(aw))) end
end) capi.root.keys(awful.util.table.join(capi.root.keys(), unpack(aw)))
else end)
glib.idle_add(glib.PRIORITY_DEFAULT_IDLE, function()
for k, v in pairs(keys) do
for _, key_name in ipairs(v) do
aw[#aw + 1] = awful.key(
{ "Mod4" },
key_name,
function()
module.focus(k)
end,
{
description = "Change focus to the " .. key_name .. " window",
group = "Navigator"
}
)
end
end
capi.root.keys(awful.util.table.join(capi.root.keys(), unpack(aw)))
end)
end
return module return module
end end