![]() ![]() #DOWNLOAD SLEEPWATCHER MAC UPDATE## Keep-alive: update existing `sudo` time stamp until `.osx` has finished while true do sudo -n true sleep 60 kill -0 "$$" || exit done 2>/dev/null & #!/bin/bash # acquire sudo at the beginning sudo -v launchctl load ~/Library/LaunchAgents/de.Īwesome! You can now restart your Mac and the launchd will run the Now just paste the code below into Terminal to add This will copy the Sleepwatcher property list file so that it can beĪdded to launchd. 2>/dev/null # unload launch agents sudo launchctl unload /Library/LaunchDaemons/de. Launchctl unload ~/Library/LaunchAgents/de. # download sleepwatcher package, untar, and cd into directory curl -remote-name "" tar xvzf sleepwatcher_2.2.tgz 2>/dev/null Sudo rm -f /usr/local/share/man/man8/sleepwatcher.8 # remove executable and man files sudo rm -f /usr/local/sbin/sleepwatcher # remove plist launchagents sudo rm -f /Library/LaunchDaemons/de. Sudo cp sleepwatcher.8 /usr/local/share/man/man8 # move files into installation folders sudo cp sleepwatcher /usr/local/sbin # create folders necessary for installation sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8 #Mac sleepwatcher download# Sudo chmod +x /etc/rc.sleep /etc/rc.wakeup # create script in local user directory and make them executable sudo touch /etc/rc.wakeup # load launch agent sudo launchctl load -w -F /Library/LaunchDaemons/de. ![]() The script begins with deleting any old version of sleepwatcher on the computer. It them moves onto downloading the package and copying the files into the appropriate places. It loads the launch daemon then creates two files, /etc/rc.sleep and /etc/rc.wakeup. These get run at their respective times, when the laptop is going to sleep or waking up. My personal /etc/rc.wakeup script is shown below. All it does is run the short AppleScript command of setting the volume to zero. To get this functionality on your computer, just copy the code below into your own /etc/rc.wakeup. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |