@guhuizaifeiyang
2018-08-26T23:33:48.000000Z
字数 1166
阅读 923
未分类
sudo periodic daily
sudo periodic weekly
sudo periodic monthly
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install *** // 安装***工具
keep your computer from sleeping
examples:
Keep your computer awake for 1 hour:
caffeinate -t 3600 &
The -t argument is based on seconds, so an hour is 60 * 60 (3600). Note that you can still sleep your computer manually when caffeinate is running.
Keep your computer from idling until a Terminal command finishes
caffeinate -i long_running_script.sh
-i prevents “idle sleeping.” Other options include:
-d just prevents the display from sleeping
-m just prevents disks from sleeping when idle
-s keeps the whole system awake
Wake up your computer
caffeinate -u -t 1
-u replicates user activity. It causes the same reaction as moving a mouse or hitting a key after your Mac sleeps.
Alfred script
(caffeinate -t "$(({query}))") && pmset sleepnow
open .