Skip to content

Instantly share code, notes, and snippets.

@SonNg2k
Forked from nileshk/mac-init
Created October 21, 2021 03:54
Show Gist options
  • Save SonNg2k/1e0f9872b02a20d2ce1be8d371f1032a to your computer and use it in GitHub Desktop.
Save SonNg2k/1e0f9872b02a20d2ce1be8d371f1032a to your computer and use it in GitHub Desktop.
OS X Config Script
#!/bin/bash
# Run this on a new OS X installation
# Disable menu bar transparency
defaults write -g AppleEnableMenuBarTransparency -bool false
# Expand save panel by default
defaults write -g NSNavPanelExpandedStateForSaveMode -bool true
# Disable press-and-hold for keys in favor of key repeat
defaults write -g ApplePressAndHoldEnabled -bool false
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable Resume for Preview.app
defaults write com.apple.Preview NSQuitAlwaysKeepsWindows -bool false
# ??? http://groups.google.com/group/blacktree-secrets/browse_thread/thread/bc333426bf414931
# defaults write ~/Library/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview NSQuitAlwaysKeepsWindows -int 0
# Disable Resume for Quicktime player
defaults write com.apple.QuicktimePlayerX NSQuitAlwaysKeepsWindows -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# Change default screenshot location
mkdir ~/Dropbox/Screenshots/$HOST_IDENTIFIER
defaults write com.apple.screencapture location $HOME/Dropbox/Screenshots/$HOST_IDENTIFIER/
# iTunes: Arrows link to library instead of store
defaults write com.apple.iTunes invertStoreLinks -boolean true
# Finder: Show stripes in list views
# Is this necessary?
#defaults write com.apple.finder FXListViewStripes -boolean true
# Fix for the ancient UTF-8 bug in QuickLook (http://mths.be/bbo)
echo "0x08000100:0" > ~/.CFUserTextEncoding
# Enable Trackpad Tap to Click at Login Screen
sudo defaults write /Library/Preferences/.GlobalPreferences com.apple.mouse.tapBehavior -int 1
# Disk Utility: Show hidden Partitions
#defaults write com.apple.DiskUtility DUShowEveryPartition -boolean
# Disable LSQuarantine (optional)
#defaults write com.apple.LaunchServices LSQuarantine -bool NO
# CyberDuck disable quarantine (optional)
#defaults write ch.sudo.cyberduck queue.download.quarantine false
#defaults write ch.sudo.cyberduck queue.download.updateIcon false
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Remove the auto-hiding Dock delay
defaults write com.apple.Dock autohide-delay -float 0
# Increase animation speed when hiding/showing the Dock
defaults write com.apple.dock autohide-time-modifier -float 0.24
# Remove the animation when hiding/showing the Dock
#defaults write com.apple.dock autohide-time-modifier -float 0
# Prevent Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Enable AirDrop with Ethernet and enable AirDrop support on unsupported Macs
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1
killall Dock
killall Finder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment