helm/rake/pkg/osx.rake

56 lines
2.1 KiB
Ruby
Raw Normal View History

require_relative '../lib/output'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
desc "Set OSX default configuration"
2014-04-11 00:31:44 -07:00
task :osx do
2014-08-30 23:50:03 -07:00
next unless is_mac?
2014-08-30 23:50:03 -07:00
if system('defaults read com.apple.finder _FXShowPosixPathInTitle >&/dev/null')
echo 'OSX settings already applied!'
next
end
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
echo "Applying OSX settings"
sh_safe 'chflags nohidden "${HOME}/Library"'
sh_safe 'defaults write NSGlobalDomain KeyRepeat -int 0'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Disable press-and-hold for keys in favor of key repeat
sh_safe 'defaults write ApplePressAndHoldEnabled -bool false'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
sh_safe 'defaults write NSGlobalDomain AppleKeyboardUIMode -int 3'
sh_safe 'defaults write NSGlobalDomain AppleFontSmoothing -int 2'
sh_safe 'defaults write NSGlobalDomain AppleShowAllExtensions -bool true'
sh_safe 'defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true'
sh_safe 'defaults write com.apple.dock autohide -bool true'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Disable app quarantine
sh_safe 'defaults write com.apple.LaunchServices LSQuarantine -bool false'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Disable auto-correct
sh_safe 'defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Avoid creating .DS_Store files on network volumes
sh_safe 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true'
# Disable the warning when changing a file extension
sh_safe 'defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
sh_safe 'defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Disable local Time Machine backups
# sh_safe 'hash_safe tmutil &> /dev/null && sudo tmutil disablelocal'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Finder: allow text selection in Quick Look
sh_safe 'defaults write com.apple.finder QLEnableTextSelection -bool true'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# When performing a search, search the current folder by default
sh_safe 'defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"'
2014-04-11 00:31:44 -07:00
2014-08-30 23:50:03 -07:00
# Use column view
sh_safe 'defaults write com.apple.finder FXPreferredViewStyle -string "clmv"'
2014-04-13 08:46:20 -07:00
2014-08-30 23:50:03 -07:00
sh_safe 'defaults write com.apple.finder ShowStatusBar -bool true'
sh_safe 'defaults write com.apple.finder _FXShowPosixPathInTitle -bool true'
sh_safe 'killall Finder'
sh_safe 'killall Dock'
2014-04-11 00:31:44 -07:00
end