Untitled
unknown
plain_text
3 years ago
617 B
8
Indexable
appWatcher = hs.caffeinate.watcher.new(function(eventType)
-- screensDidWake, systemDidWake, screensDidUnlock
if eventType == hs.caffeinate.watcher.systemWillSleep then
print('WillSleep:')
app = hs.application.get("BetterDisplay")
if app then
print(' Kill')
app:kill()
end
elseif eventType == hs.caffeinate.watcher.systemDidWake then
print('systemDidWake:')
--hs.application.open("BetterDisplay")
Atimer = hs.timer.doAfter(2, function() hs.application.open("BetterDisplay")return true end)
end
end)
appWatcher:start()Editor is loading...