-
Notifications
You must be signed in to change notification settings - Fork 4
/
run_once_after_70-mac-defaults.sh.tmpl
97 lines (72 loc) · 3.63 KB
/
run_once_after_70-mac-defaults.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
{{ if (eq .chezmoi.os "darwin") -}}
#! /usr/bin/env bash
# Tweak defaults on macOS
# this article was extremely useful for figuring out defaults commands:
# https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# essentially, you can use `defaults domains` and `defaults read` to figure out what you've changed
# important defaults cmds
# hide icons on the desktop:
defaults write com.apple.finder CreateDesktop false
defaults write org.macosforge.xquartz.X11 app_to_run /usr/local/bin/urxvt
defaults write org.macosforge.xquartz.X11 app_to_run /usr/bin/true
defaults write com.apple.dock no-bouncing -bool TRUE
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticDownload -bool NO
# make arm macOS not choke out in certain xforwarding situations
# https://github.com/XQuartz/XQuartz/issues/31
defaults write org.xquartz.X11 enable_render_extension 0
# disable things like screenshot/empty trash sound
defaults write -g com.apple.sound.uiaudio.enabled -int 0
# eff text autocorrection
defaults write -g NSAutomaticCapitalizationEnabled -bool false
defaults write -g NSAutomaticPeriodSubstitutionEnabled -bool false
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false
defaults write -g NSAutomaticDashSubstitutionEnabled -bool false
defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false
defaults write -g NSAutomaticTextCompletionEnabled -bool false
# immediately ask for PW after locking screen
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Top left screen corner -> Screen Saver
defaults write com.apple.dock wvous-tl-corner -int 5
defaults write com.apple.dock wvous-tl-modifier -int 0
# ---- ----
# unload itunes media key agent
# (this agent auto-opens iTunes/Music if you press back, play/pause, forward function keys
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist
# ---- ----
# trackpad
# Trackpad > Scroll & Zoom > Scroll direction: Natural
defaults write -g com.apple.swipescrolldirection -bool false
# Trackpad > Point & Click > Tap to click
defaults -currentHost write -g com.apple.mouse.tapBehavior 1
defaults write com.apple.AppleMultiTouchTrackpad Clicking '1'
# Trackpad > More Gestures > Swipe between pages: swipe with three fingers
# this doesnt totally work?
# defaults write -g AppleEnableSwipeNavigateWithScrolls -bool false
# defaults write com.apple.AppleMultiTouchTrackpad TrackpadThreeFingerHorizSwipeGesture -bool True
# defaults write com.apple.AppleMultiTouchTrackpad TrackpadThreeFingerVertSwipeGesture -bool True
# scale trackpad scaling past what system preferences allows
defaults write -g com.apple.trackpad.scaling 420
# ---- ----
# screenshot locations
defaults write com.apple.screencapture location ~/Downloads
# keyboard > shortcuts > app shortcuts
# chrome
defaults write com.google.Chrome NSUserKeyEquivalents -dict-add "Select Next Tab" '$\U2192'
defaults write com.google.Chrome NSUserKeyEquivalents -dict-add "Select Previous Tab" '$\U2190'
# firefox
defaults write org.mozilla.firefox NSUserKeyEquivalents -dict-add "History" '@y'
# vscode
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
{{ if .work -}}
# outlook
defaults write com.microsoft.Outlook NSUserKeyEquivalents -dict-add Calendar '$\U2192'
defaults write com.microsoft.Outlook NSUserKeyEquivalents -dict-add Mail '$\U2190'
{{- end }}
# restart everything necessary
pkill -u $(whoami) -f /System/Applications/System\ Preferences.app/Contents/MacOS/System\ Preferences
killall SystemUIServer
killall Finder
# ---- ----
{{- end }}