0
나는 화면을 깨우고 싶다 .30 분 후에 토마토 타이머처럼 화면을 닫는다.sleep 매뉴얼을 사용하는 동안`sleepscript`를 종료하는 방법은 무엇입니까?
내 코드는 다음과 같습니다.
sleepscript = [[
tell application "Terminal"
do script "Control +. C"
do script "echo 'git add -A' | sudo -S sudo shutdown -s +30"
end tell
]]
cwatcher = hs.caffeinate.watcher.new(function(ventType)
if (eventType == hs.caffeinate.watcher.systemWillSleep or
eventType == hs.caffeinate.watcher.systemWillPowerOff) then
print ("WillSleep...")
-- sleep:start()
elseif (eventType == hs.caffeinate.watcher.screensDidUnlock) then
print ("Woken...")
-- wake:start()
ok, result = hs.applescript(sleepscript)
print(result)
hs.alert.show(ok)
end
end
)
cwatcher:start()
수면 설명서 인 경우 sleepscript
을 종료하는 방법은 무엇입니까?
두 개의 수면 작업이 동시에 실행되는 것을 원하지 않습니다.
Mac을 깨운 후 30 분 후에 Mac을 잠자기 상태로 설정하고 싶습니다.
나는 이것에 대한 경험이 없지만 잠겨있지 않은 상태를 감지하면 다시 잠금 해제됩니다. ? –
@GrantGarrison 나는 스크린을 깨우고 싶다 .30 분 후에 토마토 타이머처럼 스크린을 닫는다. – jiexishede