From bee7ba2fef2b324292620e4dc4521c89aea0516f Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 10 Sep 2016 16:20:03 -0400 Subject: [PATCH] Add macos.sh --- .gitignore | 4 +- macos.sh | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 macos.sh diff --git a/.gitignore b/.gitignore index 1434341..126387a 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,6 @@ !.vim/* !.js/* -.js/.DS_Store \ No newline at end of file +.js/.DS_Store + +!macos.sh \ No newline at end of file diff --git a/macos.sh b/macos.sh new file mode 100644 index 0000000..89d67a2 --- /dev/null +++ b/macos.sh @@ -0,0 +1,143 @@ +#!/usr/bin/env bash + +# .macos - Inspired by https://github.com/mathiasbynens/dotfiles + +# Ask for the admin password +sudo -v + +# Disable boot sound effect +sudo nvram SystemAudioVolume=" " + +# Increase window resize speed for Cocoa apps +defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 + +# Expand save panel by default +defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true +defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true + +# Save to disk (not iCloud) by default +defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + +# Remove duplicates in the "Open With" menu (also see lscleanup alias) +/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user + +# Set Help Viewer windows to non-floating mode +defaults write com.apple.helpviewer DevMode --bool true + +# Restart automatically if the computer freezes +sudo systemsetup -setrestartfreeze on + +# Disable press-and-hold for keys in favor of key repeat +defaults write NSGlobalDomain ApplePressAndHoldEnable -bool false + +# Require password immediately after sleep or screen saver begins +defaults write com.apple.screensaver askForPassword -int 1 +defaults write com.apple.screensaver askForPasswordDelay -int 0 + +# Save screenshots to the desktop +defaults write com.apple.screencapture location -string "${HOME}/Desktop" + +# Show icons for hard drives, servers, removable media on the desktop +defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true +defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true +defaults write com.apple.finder ShowMountedServersOnDesktop -bool true +defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true + +# Finder: show all filename extensions +defaults write NSGlobalDomain AppleShowAllExtensions -bool true + +# Finder: When performing a search, search the current folder by default +defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" + +# Avoid creating .DS_Store files on network volumes +defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true + +# Show the ~/Library folder +chflags nohidden ~/Library + +# Show the /Volumes folder +chflags nohidden /Volumes + +# Don't automatically rearrange Spaces based on most recent use +defaults write com.apple.dock mru-spaces -bool false + +# Mail: Disable send and reply animations +defaults write com.apple.mail DisableReplyAnimations -bool true +defaults write com.apple.mail DisableSendAnimations -bool true + +# Mail: Copy email addresses as "foo@examile.com" instead of "Foo Bar " +defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false + +# Mail: Command + Enter shortcut to send email +defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\U21a9" + +# Terminal: Only use UTF-8 +defaults write com.apple.terminal StringEncodings -array 4 + +# Terminal: Use Shadowfacts.terminal theme +oascript <