logoalt Hacker News

Consumer936608/02/20250 repliesview on HN

Combined with disable wake for maintenance, I also disable wifi and bluetooth on sleep using sleepwatcher. The tradeoff is a couple of seconds for wifi to start up and find my Mac not being tracked before waking the machine again. But battery lasts forever in sleep, so I find it well worth it.

Install sleepwatcher and blueutil using brew, add these two files:

~/.sleep

  #!/bin/sh
  networksetup -setairportpower en0 off 2>&1 | tee /tmp/sleep_logs
  /run/current-system/sw/bin/blueutil -p off 2>&1 | tee /tmp/sleep_logs
~/.wakeup

    #!/bin/sh
    networksetup -setairportpower en0 on 2>&1 | tee /tmp/sleep_logs
    /run/current-system/sw/bin/blueutil -p on 2>&1 | tee /tmp/sleep_logs