-
Notifications
You must be signed in to change notification settings - Fork 0
/
macos-config
executable file
·147 lines (106 loc) · 6.45 KB
/
macos-config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Limit phone-home metrics to Apple and make macOS a little more private
# Use the hosts file to block known malware, advertising & unwanted domains
# Download reputable hosts file to /etc/hosts
curl "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" | sudo tee -a /etc/hosts
# Flush your DNS cache
sudo dscacheutil -flushcache
# Reload the /etc/hosts file
sudo killall -HUP mDNSResponder
# macOS's `mDNSResponder` (multicast DNS daemon) puts entries into your system log
# Uncomment to dump snapshot of cache entries to /var/log/system.log if you need to check
# tail -f /private/var/log/system.log
# Disable 2-finger swipe nav gestures in Chrome b/c it's just annoying
# http://osxdaily.com/2015/05/09/disable-swipe-navigation-google-chrome-mac/
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool false
# Turn macOS dashboard to speed things up / free up RAM & limit outside requests
# defaults write com.apple.dashboard mcx-disabled -boolean YES && killall Dock
# Display the full path to the Finder window you are viewing
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true && killall Finder
# Use column view in all Finder windows by default
# http://www.defaults-write.com/change-default-view-style-in-os-x-finder/
# defaults write com.apple.finder FXPreferredViewStyle Clmv
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# always display scrollbars in Finder windows
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
# Prevent macOS from automatically saving files to iCloud
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Don't send search queries to Apple
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
defaults write com.apple.dock autohide-time-modifier -float 0.25;killall Dock
# Turn off Spotlight entirely
# Spotlight uploads your search terms in real time to Apple’s remote servers
# https://support.apple.com/kb/PH18943?locale=en_US&viewlocale=en_US
# https://gist.github.com/maxfenton/c5a316f4254d27b18cf3
# This seems to prevent Alfred.app from searching your files
# sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
# macOS Quarantine stores information about ALL downloaded files in sqlite
# db is stored in ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2
# http://www.zoharbabin.com/hey-mac-i-dont-appreciate-you-spying-on-me-hidden-downloads-log-in-os-x/
# Examine the file, use SQL to query the sqlite database file:
# echo 'SELECT datetime(LSQuarantineTimeStamp + 978307200, "unixepoch") as LSQuarantineTimeStamp, LSQuarantineAgentName, LSQuarantineOriginURLString, LSQuarantineDataURLString from LSQuarantineEvent;' | sqlite3 /Users/$USER/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2
# What is this "Bonjour" thing anyways...
# https://support.apple.com/kb/PH18702?locale=en_US
# https://raymii.org/s/snippets/OS_X_Turn_Bonjour_off_or_on_via_the_command_line.html
# sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool YES
# Ensure Microsoft isn't installing things without your knowledge.
defaults write com.microsoft.autoupdate2 HowToCheck Manual
# Remove the Auto-Hide Dock Delay
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock
# Speed Up Mission Control Animations
defaults write com.apple.dock expose-animation-duration -float 0.12 && killall Dock
# Stop Full Names from Copying with Email Addresses in OS X Mail
# defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Enable Text Selection in Quick Look Windows
defaults write com.apple.finder QLEnableTextSelection -bool TRUE;killall Finder
# Always Show the User Library Folder
chflags nohidden ~/Library/
# Highlight color
# Red : `1.000000 0.733333 0.721569`
# Orange : `1.000000 0.874510 0.701961`
# Yellow : `1.000000 0.937255 0.690196`
# Green : `0.752941 0.964706 0.678431`
# Blue : `0.847059 0.847059 0.862745` (default)
# Purple : `0.968627 0.831373 1.000000`
# Pink : `0.968627 0.831373 1.000000`
# Brown : `0.929412 0.870588 0.792157`
# Graphite : `0.847059 0.847059 0.862745`
# Silver : `0.776500 0.776500 0.776500` (custom)
# Pink2 1.000000 0.000000 0.256785 (custom)
# Pink3 1.000000 0.501820 0.593916 (custom)
defaults write NSGlobalDomain AppleHighlightColor -string '1.000000 0.501820 0.593916' # Pink3
defaults write NSGlobalDomain AppleHighlightColor -string '0.847059 0.847059 0.862745' # Graphite
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Reveal IP address, hostname, OS version, etc. when clicking the clock in the login window
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# 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 \
Privileges -bool true
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Don’t animate opening applications from the Dock
defaults write com.apple.dock launchanim -bool false
# Disable automatic emoji substitution (i.e. use plain text smileys)
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false