Aqui está o que eu criei. Foi mais simples do que eu pensava.
Crie o script de shell daily_goals.sh:
#!/bin/bash
# this is needed to launch Chrome as a new window. Since it's a new window, it will open in the foreground in current space/desktop.
open -n -a Google\ Chrome
# this sleeps for 1 second. It's necessary because otherwise the website, called below, will open in existing Chrome window, which may be located in another desktop. I think sleeping lets the next 'open' call find the newly opened Chrome window, and replace the new tab with the provided website.
sleep 1
# the website I provided.
open http://joesgoals.com
Crie /Library/LaunchDaemons/daily_goals.plist
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>daily_goals</string>
<key>ProgramArguments</key>
<array>
<string>/Users/user/Work/daily_goals.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>07</integer>
<key>Minute</key>
<integer>00</integer>
</dict>
</dict>
</plist>
Adicionar ao launchctl:
launchctl load -w /Library/LaunchDaemons/daily_goals.plist
Em resumo, isso inicia o joesgoals.com todas as manhãs às 7h em uma instância do Chrome recém-aberta. Se o laptop estiver dormindo às 7h, ele deverá abrir o JoesGoals quando o laptop for reiniciado do modo de suspensão. Eu irei atualizar mais tarde se eu vir alguma peculiaridade resumindo osx em diferentes áreas de trabalho / espaços (com ou sem o Chrome). Esperando que não seja um problema.