-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-ux.sh
executable file
·240 lines (153 loc) · 10.1 KB
/
ui-ux.sh
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#!/bin/bash
#
# UI & UX preferences.
#
cd "$(dirname "${BASH_SOURCE[0]}")" \
&& . "../../../utilities.sh"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
main() {
print_subheader "UI & UX"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g AppleInterfaceStyleSwitchesAutomatically -bool true" \
"Automatically switch between light and dark mode."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
local currentUserUID="CBUser-$(dscl . -read ~ GeneratedUID | sed 's/GeneratedUID: //')"
execute "sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueLightReductionCCTTargetRaw 3269.201' /var/root/Library/Preferences/com.apple.CoreBrightness.plist && \
sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueReductionStatus:AutoBlueReductionEnabled 1' /var/root/Library/Preferences/com.apple.CoreBrightness.plist && \
sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueReductionStatus:BlueLightReductionAlgoOverride 0' /var/root/Library/Preferences/com.apple.CoreBrightness.plist && \
sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueReductionStatus:BlueReductionAvailable 1' /var/root/Library/Preferences/com.apple.CoreBrightness.plist && \
sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueReductionStatus:BlueReductionEnabled 1' /var/root/Library/Preferences/com.apple.CoreBrightness.plist && \
sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueReductionStatus:BlueReductionMode 1' /var/root/Library/Preferences/com.apple.CoreBrightness.plist && \
sudo /usr/libexec/PlistBuddy -c 'Set :$currentUserUID:CBBlueReductionStatus:BlueReductionSunScheduleAllowed 1' /var/root/Library/Preferences/com.apple.CoreBrightness.plist" \
"Enable night shift from sunset to sunrise"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.menuextra.clock DateFormat -string 'EEE d. MMM HH.mm'" \
"Show date and day of week in the menu bar"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.menuextra.clock Show24Hour -bool true" \
"Use 24 hour clock"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "sudo systemsetup -settimezone 'Europe/Copenhagen' > /dev/null && \
sudo systemsetup -setnetworktimeserver 'time.euro.apple.com' && \
sudo systemsetup -setusingnetworktime on" \
"Set 'Copenhagen' as timezone and use Apples time server."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g 'com.apple.sound.uiaudio.enabled' -int 0" \
"Enable user interface sound effects"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g 'com.apple.sound.beep.feedback' -int 0" \
"Enable feedback when volume is changed"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.menuextra.battery ShowPercent -string 'YES'" \
"Show battery percentage from the menu bar"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g ApplePersistence -bool false" \
"Disable reopen on restarts"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.CrashReporter UseUNC 1" \
"Make crash reports appear as notifications"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.LaunchServices LSQuarantine -bool false" \
"Disable 'Are you sure you want to open this application?' dialog"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.loginwindow GuestEnabled -bool false && \
defaults write com.apple.AppleFileServer guestAccess -bool false && \
defaults write com.apple.smb.server AllowGuestAccess -bool false" \
"Disable guest login"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.loginwindow PowerOffDisabled -bool false" \
"Show 'Shut Down' button on login screen"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true" \
"Show language menu in the top right corner of the boot screen"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo -string 'HostName'" \
"Show IP address, hostname, OS version, etc. when clicking the clock on boot screen"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSNavPanelExpandedStateForSaveMode -bool true && \
defaults write -g NSNavPanelExpandedStateForSaveMode2 -bool true" \
"Expand save panel by default"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g PMPrintingExpandedStateForPrint -bool true && \
defaults write -g PMPrintingExpandedStateForPrint2 -bool true" \
"Expand print panel by default"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.print.PrintingPrefs 'Quit When Finished' -bool true" \
"Automatically quit the printer app once the print jobs are completed"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.screencapture disable-shadow -bool true" \
"Disable shadow in screenshots"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.screencapture show-thumbnail -bool false" \
"Do not show thumbnail"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.screencapture location -string '${HOME}/Desktop'" \
"Save screenshots to the Desktop"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.screencapture type -string 'png'" \
"Save screenshots as PNGs"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g CGFontRenderingFontSmoothingDisabled -bool false" \
"Enable subpixel anti-aliasing (font-smoothing)"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g AppleFontSmoothing -int 1" \
"Enable subpixel font rendering on non-Apple LCDs"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true" \
"Enable HiDPI display modes"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSScrollViewRubberbanding -int 0" \
"Disable elastic rubber band scrolling"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g AppleShowScrollBars -string 'Always'" \
"Always show scrollbars"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSDisableAutomaticTermination -bool true" \
"Disable automatic termination of inactive apps"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSTableViewDefaultSizeMode -int 2" \
"Set sidebar icon size to medium"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user" \
"Remove duplicates in the “Open With” menu"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSTextShowsControlCharacters -bool true" \
"Display ASCII control characters using caret notation in standard text views"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSWindowResizeTime -float 0.001" \
"Accelerated playback when adjusting the window size."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g QLPanelAnimationDuration -float 0" \
"Disable opening a Quick Look window animations."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.helpviewer DevMode -bool true" \
"Set Help Viewer windows to non-floating mode"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.universalaccess reduceTransparency -int 0" \
"Enable transparency (menu bar, windows etc.)"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSUseAnimatedFocusRing -bool false" \
"Disable the over-the-top focus ring animation"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write -g NSToolbarTitleViewRolloverDelay -float 0" \
"Adjust toolbar title rollover delay"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false" \
"Disable resume system-wide"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
execute "for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
sudo defaults write '${domain}' dontAutoLoad -array \
'/System/Library/CoreServices/Menu Extras/TimeMachine.menu' \
'/System/Library/CoreServices/Menu Extras/Volume.menu'
done && \
sudo defaults write com.apple.systemuiserver menuExtras -array \
'/System/Library/CoreServices/Menu Extras/Bluetooth.menu' \
'/System/Library/CoreServices/Menu Extras/AirPort.menu' \
'/System/Library/CoreServices/Menu Extras/Battery.menu' \
'/System/Library/CoreServices/Menu Extras/Clock.menu'
" \
"Hide Time Machine and Volume icons from the menu bar"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
killall "SystemUIServer" &> /dev/null
}
main