Created
December 20, 2016 02:57
-
-
Save rizumita/5b9333d4ff4a5fa11a930a466ef47248 to your computer and use it in GitHub Desktop.
Delayed Command+Q by Hammerspoon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local qStartTime = 0.0 | |
local qDuration = 1.5 | |
hs.hotkey.bind({"cmd"}, "Q", function() | |
qStartTime = hs.timer.secondsSinceEpoch() | |
end, function() | |
local qEndTime = hs.timer.secondsSinceEpoch() | |
local duration = qEndTime - qStartTime | |
if duration >= qDuration then hs.application.frontmostApplication():kill() end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment