Skip to content

Instantly share code, notes, and snippets.

@jagtesh
Forked from tyilo/yosemite-bluetooth-fix.sh
Last active August 29, 2015 14:15
Show Gist options
  • Save jagtesh/de81fa1c6b45fad0ff8e to your computer and use it in GitHub Desktop.
Save jagtesh/de81fa1c6b45fad0ff8e to your computer and use it in GitHub Desktop.
Updated it for use with brew
#!/bin/bash
# Install sleepwatcher
sudo cp /usr/local/Cellar/sleepwatcher/2.2/de.bernhard-baehr.sleepwatcher-20compatibility.plist /Library/LaunchAgents/
sudo cp /usr/local/Cellar/sleepwatcher/2.2/etc/sleepwatcher/rc.* /etc/c
# Add bluetooth script to /etc/rc.wakeup (the script requires root)
sudo tee -a /etc/rc.wakeup <<EOF
kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport && sleep 3 && kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
EOF
# Load the agent to start sleepwatcher
sudo launchctl load /Library/LaunchAgents/de.bernhard-baehr.sleepwatcher-20compatibility.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment