fix keygrabber calls
This commit is contained in:
parent
d80d37bdb5
commit
b56319dc93
17
init.lua
17
init.lua
|
@ -3,7 +3,9 @@ local glib = require("lgi").GLib
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
local unpack = unpack or table.unpack -- luacheck: globals unpack
|
local unpack = unpack or table.unpack -- luacheck: globals unpack
|
||||||
local awesome, keygrabber, client, root = awesome, keygrabber, client, root
|
local awesome, keygrabber, client, root = awesome, keygrabber, client, root
|
||||||
local module = {}
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
local conversion = nil
|
local conversion = nil
|
||||||
|
|
||||||
local function generate_conversion_map()
|
local function generate_conversion_map()
|
||||||
|
@ -27,7 +29,7 @@ local function generate_conversion_map()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function run_key_sequence(seq)
|
local function run_key_sequence(seq)
|
||||||
keygrabber.stop()
|
keygrabber:stop()
|
||||||
for _, s in ipairs(seq) do
|
for _, s in ipairs(seq) do
|
||||||
if s.action == "press" then
|
if s.action == "press" then
|
||||||
root.fake_input("key_press", s.key)
|
root.fake_input("key_press", s.key)
|
||||||
|
@ -38,7 +40,7 @@ local function run_key_sequence(seq)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function run_key_sequence_xdotool(seq)
|
local function run_key_sequence_xdotool(seq)
|
||||||
keygrabber.stop()
|
keygrabber:stop()
|
||||||
|
|
||||||
local run_fn = function(s)
|
local run_fn = function(s)
|
||||||
if s.action == "press" then
|
if s.action == "press" then
|
||||||
|
@ -254,6 +256,10 @@ local function new(args)
|
||||||
awesome.connect_signal("navigator::focus", focus)
|
awesome.connect_signal("navigator::focus", focus)
|
||||||
awesome.connect_signal("navigator::navigate", navigate)
|
awesome.connect_signal("navigator::navigate", navigate)
|
||||||
|
|
||||||
|
-- add to module
|
||||||
|
M.focus = focus
|
||||||
|
M.navigate = navigate
|
||||||
|
|
||||||
-- setup keybinds
|
-- setup keybinds
|
||||||
glib.idle_add(glib.PRIORITY_DEFAULT_IDLE, function()
|
glib.idle_add(glib.PRIORITY_DEFAULT_IDLE, function()
|
||||||
local aw = {}
|
local aw = {}
|
||||||
|
@ -271,10 +277,11 @@ local function new(args)
|
||||||
end
|
end
|
||||||
root.keys(awful.util.table.join(root.keys(), unpack(aw)))
|
root.keys(awful.util.table.join(root.keys(), unpack(aw)))
|
||||||
end)
|
end)
|
||||||
return module
|
|
||||||
|
return M
|
||||||
end
|
end
|
||||||
|
|
||||||
return setmetatable(module, {
|
return setmetatable(M, {
|
||||||
__call = function(_, ...)
|
__call = function(_, ...)
|
||||||
return new(...)
|
return new(...)
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue