Forked from rizumita/hammerspoon_delayed_command_Q.lua
Created
April 12, 2022 07:48
-
-
Save confluencepoint/0d284abe0307724e6e69e70c371d5380 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