-
Notifications
You must be signed in to change notification settings - Fork 0
/
.macos
executable file
·59 lines (46 loc) · 2.14 KB
/
.macos
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
# macOS Settings
# Test to see if we have Full Disk Access to change all required settings.
if [[ -z "$(ls ~/Library/Containers/com.apple.mail 2>/dev/null)" ]]; then
# We don't have Full Disk Access. Request it.
echo "In order to continue, please allow Full Disk Access to your terminal application."
echo "After permitting access, then restart your terminal application and re-run this script."
sleep 5
# Open System Preferences and request it.
osascript <<'EOF'
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.security"
tell current pane to reveal anchor "Privacy_AllFiles"
authorize current pane
end tell
return
EOF
exit 1
fi
# Restore open documents and windows when an app is re-openned.
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool true
# Use scroll gesture with the Ctrl (^) modifier key to zoom.
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Follow the keyboard focus while zoomed in
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
# Don’t automatically rearrange Spaces based on most recent use.
defaults write com.apple.dock mru-spaces -bool false
# Minimize windows into their application's icon.
defaults write com.apple.dock minimize-to-application -bool true
# Don't show recent applications in Dock.
defaults write com.apple.dock show-recents -bool false
# Automatically hide and show the Dock.
defaults write com.apple.dock autohide -bool true
# Enable Secure Keyboard Entry in Terminal.app.
# See: https://security.stackexchange.com/a/47786/8918
defaults write com.apple.terminal SecureKeyboardEntry -bool true
# Set display to sleep after 2 mins on battery, never while charging.
sudo pmset -b displaysleep 2
sudo pmset -c displaysleep 0
# Set machine sleep to 5 minutes on battery, never while charging.
sudo pmset -b sleep 5
sudo pmset -c sleep 0
# 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