#!/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" # Finder: Show path bar defaults write com.apple.finder ShowPathbar -bool true # 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 # Disable mouse acceleration defaults write .GlobalPreferences com.apple.mouse.scaling -1 # Disable mouse scroll acceleration defaults write .GlobalPreferences com.apple.scrollwheel.scaling -1 # Fastest key repeat speed defaults write -g InitialKeyRepeat -int 15 defaults write -g KeyRepeat -int 2 # Don't automatically rearrange Spaces based on most recent use defaults write com.apple.dock mru-spaces -bool false # Dock: Set minimization effect to scale defaults write com.apple.dock mineffect -string "scale" # Dock: Automatically hide/show defaults write com.apple.dock autohide -bool true # Dock: Make hidden application icons show as translucent defaults write com.apple.dock showhidden -bool true # Dock: Remove everything from the right-hand section except the Trash defaults write com.apple.dock persistent-others -array # 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 osascript <