dotfiles/macos

105 lines
3.4 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# Set standby delay to 24 hours (default is 1 hour)
sudo pmset -a standbydelay 86400
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Dock: Remove all items.
dockutil --remove all --no-restart
# Dock: Remove the delay.
defaults write com.apple.Dock autohide-delay -float 0
# Dock: Disable launch animation
defaults write com.apple.dock launchanim -bool false
# Dock: Hide open indicators
defaults write com.apple.Dock show-process-indicators -bool false
# Dock: Hide recent apps
defaults write com.apple.Dock show-recents -bool false
# Dock: Hide by default
defaults write com.apple.Dock autohide -bool true
# Dock: Change the size of icons.
defaults write com.apple.Dock tilesize -int 35
# Hide the menu bar.
defaults write 'Apple Global Domain' _HIHideMenuBar -bool true
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
defaults write com.apple.TextEdit RichText -int 0
# Change the location for screenshots.
defaults write com.apple.screencapture location -string "${HOME}/Pictures/Screenshots"
# Disable smart dashes.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Enable full keyboard access for all controls
defaults write NSGlobalDomain AppleKeyboardUIMode -int 0
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate, and make it happen more quickly.
defaults write NSGlobalDomain InitialKeyRepeat -int 20
defaults write NSGlobalDomain KeyRepeat -int 1
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -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
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: hide status bar
defaults write com.apple.finder ShowStatusBar -bool false
# Finder: hide path bar
defaults write com.apple.finder ShowPathbar -bool false
# Finder: hide icons on the Desktop.
defaults write com.apple.finder CreateDesktop -bool false
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool true \
OpenWith -bool true \
Preview -bool false \
Privileges -bool true
# Trackpad: enable tap on click.
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
# Keyboard: Use F1, F2 as function keys.
defaults write NSGlobalDomain com.apple.keyboard.fnState -bool true
# Accessibility: enable reduce motion
defaults write com.apple.universalaccess reduceMotion -bool true
# Accessibility: enable reduce transparency
defaults write com.apple.universalaccess reduceTransparency -bool true
# Restart affected applications if `--no-restart` flag is not present.
if [[ ! ($* == *--no-restart*) ]]; then
for app in "cfprefsd" "Dock" "Finder" "SystemUIServer"; do
killall "${app}" > /dev/null 2>&1
done
fi
printf "Please log out and log back in to make all settings take effect.\n"