Created
July 15, 2016 00:58
-
-
Save emehrkay/351a875c96336c530668b31c38639300 to your computer and use it in GitHub Desktop.
Hammer spoon display sleep when Dolphin is open
This file contains 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
function applicationWatcher(appName, eventType, appObject) | |
if (appName == "Dolphin") then | |
if (eventType == hs.application.watcher.launched) then | |
hs.caffeinate.set('displayIdle', true) | |
elseif (eventType == hs.application.watcher.terminated) then | |
hs.caffeinate.set('displayIdle', false) | |
end | |
end | |
end | |
local appWatcher = hs.application.watcher.new(applicationWatcher) | |
appWatcher:start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment