Files
shell-scripting-templates/setupScripts/ssd.sh
Nathaniel Landau 066f62523a First commit
2015-01-02 20:55:03 -05:00

43 lines
1.3 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Inspired by ~/.osx — http://mths.be/osx
if [ -f "../lib/utils.sh" ]; then
source "../lib/utils.sh"
else
echo "You must have utils.sh to run. Exiting."
exit
fi
# Update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# SSD-specific tweaks #
###############################################################################
e_header "Running SSD Specific OSX Tweaks"
seek_confirmation "Confirm that you have an SSD Hard Drive"
if is_confirmed; then
e_success "Disable local Time Machine snapshots"
sudo tmutil disablelocal
e_success "Disable hibernation (speeds up entering sleep mode)"
sudo pmset -a hibernatemode 0
e_success "Remove the sleep image file to save disk space"
sudo rm /Private/var/vm/sleepimage
e_success "Create a zero-byte file instead…"
sudo touch /Private/var/vm/sleepimage
e_success "…and make sure it cant be rewritten"
sudo chflags uchg /Private/var/vm/sleepimage
e_success "Disable the sudden motion sensor as its not useful for SSDs"
sudo pmset -a sms 0
e_note "DON'T FORGET TO RESTART FOR CHANGES TO TAKE EFFECT"
e_header "Completed SSD Specific OSX Tweaks"
fi