-
Notifications
You must be signed in to change notification settings - Fork 0
/
.osx
219 lines (176 loc) · 7.44 KB
/
.osx
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/bin/sh
# This is a set of sane OS X defaults
# A lot of this was stolen from https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Enables key repeating
defaults write -g ApplePressAndHoldEnabled -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
# Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
# Place the dock on the right
defaults write com.apple.dock orientation right
# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Avoid creatng .DS_Store files on USB volumes
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Enable Dark Mode
defaults write NSGlobalDomain AppleInterfaceStyle Dark
# Graphite instead of Blue system color
defaults write NSGlobalDomain AppleAquaColorVariant -int 6
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Display full POSIX path as Finder window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Enable tap to click (Trackpad)
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true
# Map bottom right Trackpad corner to right-click
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.AppleMultitouchTrackpad TrackpadCornerSecondaryClick -int 2
# Set a fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 25
# Change default screenshot location from Desktop to ~/Screenshots
mkdir -p ~/Screenshots/
defaults write com.apple.screencapture location ~/Screenshots/
# Save screenshots in PNG format
defaults write com.apple.screencapture type -string "png"
# Save to disk (not to iCloud) by default
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
# Disable “natural” (Lion-style) scrolling
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Disable three finger swipe for expose, mission control and launchpad
# Goal is to drive keyboard usage
defaults write com.apple.dock showAppExposeGestureEnabled -bool false
defaults write com.apple.dock showLaunchpadGestureEnabled -bool false
defaults write com.apple.dock showMissionControlGestureEnabled -bool false
# Disable the globe/fn emoji selector
defaults write com.apple.HIToolbox AppleFnUsageType -int 0
# Disable dictation
defaults write com.apple.HIToolbox AppleDictationAutoEnable -int 0
# Do not re arrange spaces based on use this breaks a lot of window tooling
defaults write com.apple.dock mru-spaces -bool false
# Wipe all (default) app icons from the Dock
defaults write com.apple.dock persistent-apps -array
# Don't play user interface sound effects
defaults write com.apple.systemsound com.apple.sound.uiaudio.enabled -bool false
# Don't play feedback when volume is changed
defaults write NSGlobalDomain com.apple.sound.beep.feedback -bool false
# Don't flash the screen when an alert sound occurs (accessibility)
defaults write NSGlobalDomain com.apple.sound.beep.flash -bool false
# Disable Cmd-` default app switcher
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 27 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>96</integer>
<integer>50</integer>
<integer>1048576</integer>
</array>
</dict>
</dict>
"
# Disable Cmd-Alt-Space show finder search window
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 65 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>32</integer>
<integer>49</integer>
<integer>1572864</integer>
</array>
</dict>
</dict>
"
# Disable Cmd-Space show spotlight search
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 64 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>32</integer>
<integer>49</integer>
<integer>1048576</integer>
</array>
</dict>
</dict>
"
# Disable Ctrl-Space: select the previous input source
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 60 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>32</integer>
<integer>49</integer>
<integer>262144</integer>
</array>
</dict>
</dict>
"
# Disable Ctrl-Alt-Space: select next source in input menu
defaults write com.apple.symbolichotkeys.plist AppleSymbolicHotKeys -dict-add 61 "
<dict>
<key>enabled</key><false/>
<key>value</key><dict>
<key>type</key><string>standard</string>
<key>parameters</key>
<array>
<integer>32</integer>
<integer>49</integer>
<integer>786432</integer>
</array>
</dict>
</dict>
"
# Need to restart UI for some changes to take effect.
killall SystemUIServer Dock "System Preferences"
defaults write com.apple.activatesettings log true
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
# Enable loading of iterm2 config from dotfiles.
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/.config/iterm2"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true
# Disable hiding of kitty windows to free up cmd-h binding
# https://github.com/kovidgoyal/kitty/issues/948#issuecomment-420812225
defaults write net.kovidgoyal.kitty NSUserKeyEquivalents -dict-add "Hide kitty" '\0'
defaults write net.kovidgoyal.kitty NSUserKeyEquivalents -dict-add "Hide Others" '\0'
# Alt-Tab app mapping aligned with karabiner
defaults write com.lwouis.alt-tab-macos holdShortcut "\\U2318"
defaults write com.lwouis.alt-tab-macos nextWindowShortcut F19
defaults write com.lwouis.alt-tab-macos holdShortcut2 "\\U2318"
defaults write com.lwouis.alt-tab-macos nextWindowShortcut2 F18
# This needs brew install duti to be run
#
#
if [ -x /opt/homebrew/bin/duti ]; then
# open svg files in Firefox
duti -s org.mozilla.firefox svg all
# Open webm and mkv in vlc
duti -s org.videolan.vlc org.matroska.mkv all
duti -s org.videolan.vlc webm all
else
echo 'Run btew install duti and rerun to fix file associations'
fi