Skip to content

Commit

Permalink
Improve keygrabber exit (#31)
Browse files Browse the repository at this point in the history
* Default to "q" after "Escape" for exit_key

* Abort keygrabber with Ctrl-C always
  • Loading branch information
blueyed authored Dec 27, 2018
1 parent 6d1dcd3 commit 228c456
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 228c456

Please sign in to comment.