-
Notifications
You must be signed in to change notification settings - Fork 0
/
.macos
executable file
·103 lines (70 loc) · 3.12 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
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
#!/bin/zsh
#print settings with 'defaults read'
# close any system preference windows first
osascript -e 'tell application "System Preferences" to quit'
# become root
sudo -v
# stay root
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
####################################
# System
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Enable Firewall
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
####################################
# Trackpad, keyboard
## macOS Ventura
defaults write "Apple Global Domain" ContextMenuGesture -int 1
# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -int 1
## macOS Ventura
defaults write com.apple.AppleMultitouchTrackpad Clicking -int 1
# Trackpad: map bottom right corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
## macOS Ventura
defaults write com.apple.AppleMultitouchTrackpad TrackpadCornerSecondaryClick -int 2
# macOS Ventura specific
# Disable this setting so that the right click with bottom right corner works
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 0
## macOS Ventura
defaults write com.apple.AppleMultitouchTrackpad TrackpadRightClick -int 0
# use keyboard navigation to move focus between controls (tab-tab for everything)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Non-breaking spaces: https://superuser.com/questions/78245/how-to-disable-the-option-space-key-combination-for-non-breaking-spaces
#mkdir -p ~/Library/KeyBindings
#cat > ~/Library/KeyBindings/DefaultKeyBinding.dict <<EOF
#{
#"~ " = ("insertText:", " ");
#}
#EOF
####################################
## Sound
defaults write "Apple Global Domain" com.apple.sound.uiaudio.enabled -int 0
####################################
## Menu widgets
## Clock with seconds
defaults write "Apple Global Domain" com.apple.menuextra.clock.Show24Hour -int 0
defaults write "Apple Global Domain" com.apple.menuextra.clock.ShowAMPM -int 1
defaults write "Apple Global Domain" com.apple.menuextra.clock.ShowSeconds -int 1
####################################
# Screen
# 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
####################################
# Locations
# Screenshot location
test -d "${HOME}/Pictures/screenshots" || mkdir -p "${HOME}/Pictures/screenshots"
defaults write com.apple.screencapture location -string "${HOME}/Pictures/screenshots"
# Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
# Show the ~/Library folder
chflags nohidden ~/Library
# Show the /Volumes folder
sudo chflags nohidden /Volumes
####################################
# Iterm2
# Don’t display the annoying prompt when quitting iTerm
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
echo "Applied settings. System reboot required""