helm/rake/osx.rake

54 lines
2.1 KiB
Ruby
Raw Normal View History

2014-04-11 00:31:44 -07:00
require_relative 'lib/output'
task :osx do
2014-06-17 20:19:48 -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
echo "Applying OSX settings"
2014-06-15 22:24:05 -07:00
sh_safe 'chflags nohidden "${HOME}/Library"'
sh_safe 'defaults write NSGlobalDomain KeyRepeat -int 0'
2014-04-11 00:31:44 -07:00
# Disable press-and-hold for keys in favor of key repeat
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write ApplePressAndHoldEnabled -bool false'
2014-04-11 00:31:44 -07:00
2014-06-15 22:24:05 -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
# Disable app quarantine
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.LaunchServices LSQuarantine -bool false'
2014-04-11 00:31:44 -07:00
# Disable auto-correct
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false'
2014-04-11 00:31:44 -07:00
# Avoid creating .DS_Store files on network volumes
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true'
2014-04-11 00:31:44 -07:00
# Disable the warning when changing a file extension
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false'
2014-04-11 00:31:44 -07:00
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true'
2014-04-11 00:31:44 -07:00
# Disable local Time Machine backups
2014-06-15 22:24:05 -07:00
# sh_safe 'hash_safe tmutil &> /dev/null && sudo tmutil disablelocal'
2014-04-11 00:31:44 -07:00
# Finder: allow text selection in Quick Look
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.finder QLEnableTextSelection -bool true'
2014-04-11 00:31:44 -07:00
# When performing a search, search the current folder by default
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"'
2014-04-11 00:31:44 -07:00
# Use column view
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.finder FXPreferredViewStyle -string "clmv"'
2014-04-11 00:31:44 -07:00
2014-06-15 22:24:05 -07:00
sh_safe 'defaults write com.apple.finder ShowStatusBar -bool true'
sh_safe 'defaults write com.apple.finder _FXShowPosixPathInTitle -bool true'
2014-04-13 08:46:20 -07:00
2014-06-15 22:24:05 -07:00
sh_safe 'killall Finder'
sh_safe 'killall Dock'
2014-04-11 00:31:44 -07:00
end