Skip to content

Instantly share code, notes, and snippets.

@blueyed
Last active March 17, 2021 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blueyed/386a0657bedc4beaeaf9 to your computer and use it in GitHub Desktop.
Save blueyed/386a0657bedc4beaeaf9 to your computer and use it in GitHub Desktop.
-- Do not grab global / client keys when the xev event tester window is focused.
do
local saved = {}
function xev_globalkeys_focus(c)
if c.name == 'Event Tester' then
saved.root, saved.client = root.keys(), c.keys
root.keys({})
-- Only map alt-f4.
c.keys = {awful.key({ "Mod1", }, "F4", function (c) c:kill() end)}
end
end
function xev_globalkeys_unfocus(c)
if c.name == 'Event Tester' then
root.keys(saved.root)
c.keys = saved.client
end
end
client.connect_signal("focus", xev_globalkeys_focus)
client.connect_signal("unfocus", xev_globalkeys_unfocus)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment