-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_once_after_macos_settings.sh.tmpl
158 lines (116 loc) · 6.12 KB
/
run_once_after_macos_settings.sh.tmpl
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
148
149
150
151
152
153
154
155
156
157
158
{{- if eq .chezmoi.os "darwin" -}}
#! /bin/sh
echo Setting MacOS settings
###### Trackpad ######
echo Set trackpad speed to medium high
defaults write NSGlobalDomain com.apple.trackpad.scaling -int 2
# # Set bottom right of trackpad to secondary click
# defaults write com.apple.AppleMultitouchTrackpad TrackpadCornerSecondaryClick -int 2
# defaults write com.apple.AppleMultitouchTrackpad TrackpadRightClick -bool false
echo Set secondary click to click with 2 fingers
defaults write com.apple.AppleMultitouchTrackpad TrackpadCornerSecondaryClick -int 0
defaults write com.apple.AppleMultitouchTrackpad TrackpadRightClick -bool true
echo Turn off swipe for page turns/forward/back
defaults write NSGlobalDomain AppleEnableSwipeNavigateWithScrolls -bool false
echo Various trackpad gestures
defaults write com.apple.AppleMultitouchTrackpad TrackpadFiveFingerPinchGesture -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadFourFingerHorizSwipeGesture -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadFourFingerPinchGesture -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadFourFingerVertSwipeGesture -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerDrag -int 0
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerHorizSwipeGesture -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerTapGesture -int 0
defaults write com.apple.AppleMultitouchTrackpad TrackpadThreeFingerVertSwipeGesture -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadTwoFingerDoubleTapGesture -int 0
defaults write com.apple.AppleMultitouchTrackpad TrackpadTwoFingerFromRightEdgeSwipeGesture -int 3
###### Keyboard ######
echo Set fast keyboard repeat and short delay
defaults write NSGlobalDomain InitialKeyRepeat -int 15
defaults write NSGlobalDomain KeyRepeat -int 2
###### General UI fixes
echo Set preferred search provider
defaults write NSGlobalDomain 'NSPreferredWebServices' '{NSWebServicesProviderWebSearch = {NSDefaultDisplayName = DuckDuckGo; NSProviderIdentifier = "com.duckduckgo";};}'
echo Set dark mode
defaults write NSGlobalDomain AppleInterfaceStyle -string "Dark"
echo Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
echo Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# echo Save to disk (not to iCloud) by default
# defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
echo Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
echo Save screenshots in PNG format '(other options: BMP, GIF, JPG, PDF, TIFF)'
defaults write com.apple.screencapture type -string "png"
echo Always show scroll bars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
####### Dock and corner gestures ######
echo Hot corners
# Possible values:
# 0: no-op
# 2: Mission Control
# 3: Show application windows
# 4: Desktop
# 5: Start screen saver
# 6: Disable screen saver
# 7: Dashboard
# 10: Put display to sleep
# 11: Launchpad
# 12: Notification Center
echo Bottom right screen corner Mission Control
defaults write com.apple.dock wvous-br-corner -int 2
defaults write com.apple.dock wvous-br-modifier -int 0
echo Top right screen corner Notification Center
defaults write com.apple.dock wvous-tr-corner -int 12
defaults write com.apple.dock wvous-tr-modifier -int 0
echo Bottom left screen corner Launchpad
defaults write com.apple.dock wvous-bl-corner -int 11
defaults write com.apple.dock wvous-bl-modifier -int 0
# Top left screen corner - no action
defaults write com.apple.dock wvous-tl-corner -int 0
defaults write com.apple.dock wvous-tl-modifier -int 0
echo Set dock tile size
defaults write com.apple.dock tilesize -int 36
###### Finder ######
# Finder: show hidden files by default
# defaults write com.apple.finder AppleShowAllFiles -bool true
echo Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
echo When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
echo Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
echo Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `Nlsv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
echo Small finder sidebar icons
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1
echo Show the ~/Library folder
chflags nohidden ~/Library
echo Set Home as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write com.apple.finder NewWindowTarget -string "PfHm"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
###### Maccy ######
echo Maccy - Set my preferred key combo
defaults write org.p0deje.Maccy KeyboardShortcuts_popup -string "{\"carbonModifiers\":256,\"carbonKeyCode\":39}"
echo Paste by default
defaults write org.p0deje.Maccy pasteByDefault -bool true
echo Fuzzy Search
defaults write org.p0deje.Maccy fuzzySearch -bool true
###### iTerm2 ######
echo Tell iTerm2 to look in this repo for my settings
defaults write com.googlecode.iterm2 PrefsCustomFolder -string "~/.local/share/chezmoi"
defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true
###### Adobe Acrobat Reader ######
echo Tell Acrobat Reader to run natively on M1
defaults write com.adobe.Reader AcrobatRunInNativeModeDC -bool true
###### Terminal.app #######
echo Attempting to set Terminal.app default theme
theme=$(<~/.local/share/chezmoi/TomVTerminal.xml)
plutil -replace Window\ Settings.TomV -xml "$theme" ~/Library/Preferences/com.apple.Terminal.plist
defaults write com.apple.Terminal "Default Window Settings" -string "TomV"
defaults write com.apple.Terminal "Startup Window Settings" -string "TomV"
{{- end }}