LoginSignup
3
2

More than 5 years have passed since last update.

Karabiner の Command+Q なあれ(Hammerspoon版)

Posted at

Sierra にアップグレードして困らないための準備
Press Command+Q twice to Quit Application の代替

前準備

Hammerspoon のインストール

$ brew cask install hammerspoon

init.lua

init.lua
local quitModal = hs.hotkey.modal.new('cmd','q')

function quitModal:entered()
    -- hs.alert.show("Press Cmd+Q again to quit", 1)
    hs.timer.doAfter(1, function() quitModal:exit() end)
end

local function killApp()
    hs.console.printStyledtext('killApp')
    hs.application.frontmostApplication():kill()
    quitModal:exit()
end

quitModal:bind('cmd', 'q', killApp)
quitModal:bind('', 'escape', function() quitModal:exit() end)

参考情報

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2