Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve keygrabber exit #31

Merged
merged 2 commits into from
Dec 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,11 @@ cyclefocus.cycle = function(startdirection_or_args, args)
-- Use "Escape" as exit_key if not used as key.
local exit_key = args.exit_key
if exit_key == nil then
if not awful.util.table.hasitem(keys, 'Escape') then
exit_key = 'Escape'
for _,key in pairs({'Escape', 'q'}) do
if not awful.util.table.hasitem(keys, key) then
exit_key = key
break
end
end
end

Expand Down Expand Up @@ -890,6 +893,9 @@ cyclefocus.cycle = function(startdirection_or_args, args)

if exit_key and key == exit_key then
return exit_grabber(initiating_client)
elseif #mod == 1 and mod[1] == 'Control' and key == 'c' then
-- exit on Ctrl-C always.
return exit_grabber(initiating_client)
end

-- Direction (forward/backward) is determined by status of shift.
Expand Down