Skip to content

Instantly share code, notes, and snippets.

@emehrkay
Created July 15, 2016 00:58
Show Gist options
  • Save emehrkay/351a875c96336c530668b31c38639300 to your computer and use it in GitHub Desktop.
Save emehrkay/351a875c96336c530668b31c38639300 to your computer and use it in GitHub Desktop.
Hammer spoon display sleep when Dolphin is open
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