Skip to content

Instantly share code, notes, and snippets.

@phuctm97
Last active March 14, 2020 10:45
Show Gist options
  • Save phuctm97/92afe1c8ca0ad81c23a8bd1a2da3ca04 to your computer and use it in GitHub Desktop.
Save phuctm97/92afe1c8ca0ad81c23a8bd1a2da3ca04 to your computer and use it in GitHub Desktop.
macOS preferences
#!/bin/bash
# Enable auto hide.
defaults write com.apple.dock autohide -bool true
# Hide process indicators.
defaults write com.apple.dock show-process-indicators -bool false
# Set orientation.
defaults write com.apple.dock orientation -string left
# Don't show recent applications.
defaults write com.apple.dock show-recents -bool false
# Show only active applications.
defaults write com.apple.dock static-only -bool true
# Clear persistent applications.
defaults write com.apple.dock persistent-apps -array
defaults write com.apple.dock persistent-others -array
defaults write com.apple.dock recent-apps -array
# Change Dock size.
defaults write com.apple.dock tilesize -float 44
# Lock Dock size.
defaults write com.apple.Dock size-immutable -bool true
# Restart Dock.app.
killall Dock
#!/bin/bash
# Don't show external, removable and network media on Desktop.
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# Search on current folder.
defaults write com.apple.finder FXDefaultSearchScope -string SCcf
# Remove Trash items after 30 days.
defaults write com.apple.finder FXRemoveOldTrashItems -bool true
# Show all file extensions.
defaults write -g AppleShowAllExtensions -bool true
# Restart Finder.app.
killall Finder
# Set Desktop wallpaper.
osascript -e "tell application \"Finder\" to set desktop picture to \"/System/Library/Desktop Pictures/Catalina Rock.heic\" as POSIX file"
#!/bin/bash
# Configure Spotlight search results.
defaults write com.apple.Spotlight orderedItems -array ''
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = APPLICATIONS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = SYSTEM_PREFS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = MENU_SPOTLIGHT_SUGGESTIONS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = MENU_CONVERSION; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = MENU_EXPRESSION; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = MENU_DEFINITION; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = MENU_OTHER; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = DIRECTORIES; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = DOCUMENTS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = PRESENTATIONS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = SPREADSHEETS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = PDF; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = EVENT_TODO; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = BOOKMARKS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = CONTACT; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = MESSAGES; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = IMAGES; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = MOVIES; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 1; name = MUSIC; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = FONTS; }'
defaults write com.apple.Spotlight orderedItems -array-add '{ enabled = 0; name = SOURCE; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment