-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_macrc
executable file
·2151 lines (1642 loc) · 92.2 KB
/
dot_macrc
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
# Close any open System Preferences panes, to prevent them from overriding
# settings we're about to change
#osascript -e 'tell application "System Preferences" to quit' || true ;
export LANG=${LANG:-"en_US"}
source ~/.bashrc 2>/dev/null || true
hash -p /usr/libexec/PlistBuddy PlistBuddy
#-----------------------------------------------------------#
# Variables #
#-----------------------------------------------------------#
export DEFAULT_SAVE_LOCATION="~/Documents"
if [[ ( -e "/Volumes/Music Drive/Music/" ) ]] ; then
export MUSIC_LIBRARY_LOCATION="/Volumes/Music Drive/Music/Media/"
else
if [[ ( -d "/Users/Shared/Music/" ) ]] ; then
export MUSIC_LIBRARY_LOCATION="/Users/Shared/Music/"
else
export MUSIC_LIBRARY_LOCATION="${HOME:-/Users/Shared}/Music/Music/"
fi
fi
export ZERO_UUID="00000000-0000-0000-0000-000000000000"
export CURRENT_DATE_TIME=$(date -j "+%Y-%m-%d %H:%M:00 +0800")
export CURRENT_SECONDS=$(date -j "+%s")
declare -i MAX_DOWNLOAD_CONNECTIONS=5
OS_VERSION=$(sw_vers -productVersion)
OS_VERSION_MAJOR=$(printf "%s\n" $OS_VERSION | cut -d. -f 1-2 )
# OPTION FLAGS
# Uncomment an option to override user settings and defaults
# Developer mode
#export USE_DEVELOPER_SETUP="YES"
export USE_DEBUG_MODE="${USE_DEBUG_MODE:-NO}" ;
# Graphics mode
# (USE "NO" if you're on an older Mac that messes up the animation)
#export USE_FANCY_GRAPHICS="NO"
#export USE_BLUETOOTH="YES"
# DO NOT CHANGE THIS
# automatically configure iCloud values
if [[ ( $(defaults export MobileMeAccounts - | grep -A5 -F AccountDSID | grep -coiF "iCloud" ) -eq 1 ) ]] ||\
[[ ($HAS_CLOUD_ID == "YES") ]] ; then
export CLOUD_ID=$(defaults find AccountDSID | grep -F AccountDSID | grep -oE '^\s*[A]{1}[c]{2}[o]{1}.*' | head -n 1 | tr -d '; ' | cut -d\= -f 2-2)
export CLOUD_UUID=$(defaults read MobileMeAccounts | grep -F AccountUUID | grep -oE '^\s*[A]{1}[c]{2}[o]{1}.*' | head -n 1 | tr -d '\"; ' | cut -d\= -f 2-2)
export CLOUD_UN=$(defaults find AccountDSID | grep -F DisplayName | head -n 1 | tr -d ';' | cut -d\= -f 2 | grep -oE "\".+\"" | tr -d '"')
export AUTHOR_NAME="${CLOUD_UN:-${LOGNAME}}"
export CLOUD_EMAIL=$(defaults find AccountDSID | grep -F AccountID | grep -oE '^\s*[A]{1}[c]{2}[o]{1}.*' | head -n 1 | tr -d '\"; ' | cut -d\= -f 2)
export HAS_CLOUD_ID="YES"
else
# (sign in in system prefs to appleID instead.)
export HAS_CLOUD_ID="NO"
export AUTHOR_NAME="${LOGNAME:-Unknown}"
export -n CLOUD_EMAIL ;
export CLOUD_UUID=${CLOUD_UUID:-$ZERO_UUID}
fi
# these keys need to be stored and retrieved with security -key commands
#CAL_UUID=""
#FACETIME_MESSAGES_ID=""
#MESSAGES_ID=""
export HW_UUID=$(system_profiler -json SPHardwareDataType | grep -F "platform_UUID" | cut -d: -f 2 | tr -d '" ,')
export TOKEN_ID=$(defaults read com.apple.findmy.fmfcore.notbackedup publicAPSToken 2>/dev/null)
#-----------------------------------------------------------#
# All other UUIDs only appear once, #
# you will need to change these manually. #
#-----------------------------------------------------------#
#-----------------------------------------------------------#
# Functions #
#-----------------------------------------------------------#
function WRITE() {
DEFAULTS=$(command -v defaults)
printf "%s\n" "Configuring ${1} ${2:-}" ;
if [[ ("${USE_DEVELOPER_SETUP}" == "YES") ]] ; then
printf "%s\n" " Will use key \"${2:-'<empty>'}\" " ;
printf "%s\n" " Will use type \"${3:-data}\" " ;
fi
if [[ ( $(printf "%s\n" "-"$(${DEFAULTS} read-type "${1}" "${2:-}" 2>/dev/null | cut -d\ -f 3 | sed -Ee 's/integer/int/g' | sed -Ee 's/dictionary/dict/g' | sed -Ee 's/boolean/bool/g' )) == $(printf "%s\n" "${3:-data}" | sed -Ee 's/-add//g') ) ]] ; then
${DEFAULTS} write "${1}" "${2:-}" "${@:3:$#}" || printf "%s\n" "args: \"${2:-}\" \"${@:3:$#}\"" ;
else
printf "%s\n" " Should use type \"-"$(${DEFAULTS} read-type "${1}" "${2:-}" 2>/dev/null | cut -d\ -f 3 | sed -Ee 's/integer/int/g' | sed -Ee 's/dictionary/dict/g' | sed -Ee 's/boolean/bool/g')"\""
if [[ ("${USE_DEVELOPER_SETUP}" == "YES") ]] ; then
printf "%s\n" " DEVELOPER OVERRIDE (Admin Help You, You'll NEED it to recover!)" ;
${DEFAULTS} write "${1}" "${2:-}" "${@:3:$#}" || printf "%s\n" "args: \"${2:-}\" \"${@:3:$#}\"" ;
printf "%s\n" " " ;
else
printf "%s\n" " SKIPPING INSTEAD (safety)" ;
fi ;
fi ;
return $? ;
}
function DISABLE() {
DEFAULTS=$(command -v defaults)
if [[ ( $(${DEFAULTS} read "${1}" "${@:2:$#}" 2>/dev/null) -ne 0 ) ]] ; then
printf "%s\n" "Disabling ${1} ${@:2:$#}" ;
${DEFAULTS} write "${1}" "${@:2:$#}" -bool NO ;
else
printf "%s\n" "Skipping ${1} ${@:2:$#} as it is already disabled" ;
fi
if [[ ( $(${DEFAULTS} read "${1}" "${@:2:$#}" 2>/dev/null) -eq 0 ) ]] ; then
return 0 ;
else
printf "%s\n" "Error ${1} ${@:2:$#} is still NOT enabled" >&2 && false;
return 255 ;
fi
}
function ENABLE() {
DEFAULTS=$(command -v defaults)
if [[ ( $(${DEFAULTS} read "${1}" "${@:2:$#}" 2>/dev/null ) -eq 0 ) ]] ; then
printf "%s\n" "Enabling ${1} ${@:2:$#}" ;
${DEFAULTS} write "${1}" "${@:2:$#}" -bool YES ;
else
printf "%s\n" "Skipping ${1} ${@:2:$#} as it is already enabled" ;
fi
if [[ ( $(${DEFAULTS} read "${1}" "${@:2:$#}" 2>/dev/null) -eq 1 ) ]] ; then
return 0 ;
else
printf "%s\n" "Error ${1} ${@:2:$#} is still NOT enabled" >&2 && false;
return 255 ;
fi
}
function DELETE() {
DEFAULTS=$(command -v defaults)
if [[ ( $(${DEFAULTS} read "${1}" "${@:2:$#}" 2>/dev/null | wc -l) -gt 0 ) ]] ; then
printf "%s\n" "Deleting ${1} ${@:2:$#}" ;
${DEFAULTS} delete "${1}" "${@:2:$#}" || printf "%s\n" "Error delete failed" >&2 ;
else
printf "%s\n" "Skipping ${1} ${@:2:$#} as there is nothing to delete" ;
fi
if [[ ( $(${DEFAULTS} read "${1}" "${@:2:$#}" 2>/dev/null | wc -l) -lt 1 ) ]] ; then
return 0 ;
else
printf "%s\n" "Error ${1} ${@:2:$#} is still NOT deleted" >&2 && false;
return 255 ;
fi
}
function ENFORCE_GRAPHICS_MODE() {
LAST_ARG=$(($#-1))
if [[ ("${USE_FANCY_GRAPHICS}" == "YES") ]] ; then
printf "%s\n" "Optimizing for fancy graphics enabled"
if [[ ( "${@:$#:$#}" == "YES" ) ]] ; then
ENABLE "${@:1:$LAST_ARG}"
else
DISABLE "${@:1:$LAST_ARG}"
fi
else
printf "%s\n" "Optimizing for faster graphics response"
if [[ ( "${@:$#:$#}" == "YES" ) ]] ; then
DISABLE "${@:1:$LAST_ARG}"
else
ENABLE "${@:1:$LAST_ARG}"
fi
fi
return $? ; # might not return the right code (might return result of if instead)
}
function ENFORCE_DEV_MODE() {
LAST_ARG=$(($#-1))
if [[ ("${USE_DEVELOPER_SETUP}" == "YES") ]] ; then
printf "%s\n" "Optimizing for developer user"
if [[ ( "${@:$#:$#}" == "YES" ) ]] ; then
ENABLE "${@:1:$LAST_ARG}"
else
DISABLE "${@:1:$LAST_ARG}"
fi
else
printf "%s\n" "Optimizing for normal user"
if [[ ( "${@:$#:$#}" == "YES" ) ]] ; then
DISABLE "${@:1:$LAST_ARG}"
else
ENABLE "${@:1:$LAST_ARG}"
fi
fi
return $? ; # might not return the right code (might return result of if instead)
}
function ENFORCE_DEBUG_MODE() {
LAST_ARG=$(($#-1))
local EXIT_CODE=0 ;
if [[ ("${USE_DEBUG_MODE}" == "YES") ]] ; then
printf "%s\n" "Optimizing Debug-Mode for developer user" ;
if [[ ( "${USE_DEVELOPER_SETUP}" == "YES" ) ]] ; then
ENFORCE_DEV_MODE "${@:1:$LAST_ARG}" "${@:$#:$#}"
EXIT_CODE=$? ;
else
printf "%s\n" " Except you are NOT a developer user!" >&2 ;
printf "%s\n" " Optimizing run-mode for normal user INSTEAD (safety)" ;
DISABLE "${@:1:$LAST_ARG}" ;
EXIT_CODE=$? ;
fi
else
printf "%s\n" "Optimizing run-mode for normal user"
DELETE "${@:1:$LAST_ARG}"
EXIT_CODE=$? ;
fi
return $EXIT_CODE ; # might not return the right code (might return result of if instead)
}
MKDIR="$(command -v mkdir) -m 755"
PPDOM="com.apple"
GPDOM="com.google"
if [[ ( -r "${HOME}/.UserPreferences" ) ]] ; then
## WILL ADD USER PREFS HERE
# load user variables (IGNORES SHELL COMMANDS)
export -f WRITE
export -f DELETE
export -f ENABLE
export -f DISABLE
export -f ENFORCE_GRAPHICS_MODE
export -f ENFORCE_DEV_MODE
source <(grep -oE "^(?:\s*)?[-0-9A-Z_]+[=]{1}.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g' | grep -ovE "^WRITE" | grep -ovE "^DEFAULTS") || true
# loads ALLOWED user SETTINGS (IGNORES OTHER SHELL COMMANDS)
printf "%s\n" "dev mode is set to ${USE_DEVELOPER_SETUP}"
printf "%s\n" "Debug mode is set to ${USE_DEBUG_MODE:-unset}"
export USE_DEVELOPER_SETUP="${USE_DEVELOPER_SETUP:-NO}" ;
export USE_DEBUG_MODE="${USE_DEBUG_MODE:-NO}" ;
export CAL_UUID="${CAL_UUID:-${ZERO_UUID}}" ;
export USE_FANCY_GRAPHICS="${USE_FANCY_GRAPHICS:-NO}" ;
export USE_BLUETOOTH="${USE_BLUETOOTH:-YES}" ;
source <(grep -oE "^(?:\s*)?(?:DELETE){1}(?:\s*)+.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g') || true
source <(grep -oE "^(?:\s*)?(?:ENABLE){1}(?:\s*)+.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g') || true
source <(grep -oE "^(?:\s*)?(?:DISABLE){1}(?:\s*)+.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g') || true
source <(grep -oE "^(?:\s*)?(?:WRITE){1}(?:\s*)+.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g') || true
source <(grep -oE "^(?:\s*)?(?:ENFORCE_GRAPHICS_MODE){1}(?:\s*)+.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g') || true
source <(grep -oE "^(?:\s*)?(?:ENFORCE_DEV_MODE){1}(?:\s*)+.+$" "${HOME}/.UserPreferences" | sed -Ee 's/^[[:space:]]+//g') || true
else
export USE_DEVELOPER_SETUP="${USE_DEVELOPER_SETUP:-NO}" ;
export USE_FANCY_GRAPHICS="${USE_FANCY_GRAPHICS:-NO}" ;
export USE_BLUETOOTH="${USE_BLUETOOTH:-YES}" ;
fi
#-----------------------------------------------------------#
# To Be Deleted #
#-----------------------------------------------------------#
for BAD_DOMAIN in AppleMediaServices DiskUtility EmojiCache UIKit avfoundation.frecents audio.AudioMIDISetup bookstoreagent stockholm stocks stocks.account macos.classroom garageband10 Messages imessage EmojiPreferences PTPCamera Preview.ImageSizingPresets Preview.ViewState proactive.PersonalizationPortrait registration MobileDeviceCrashCopy dockfixup ids.deviceproperties internal.ck studentd ScriptEditor2 ; do
DELETE ${PPDOM}.${BAD_DOMAIN} 2>/dev/null || true
done ;
#-----------------------------------------------------------#
# Deletion Probation #
#-----------------------------------------------------------#
DELETE org.gpgtools.gpgmail 2>/dev/null || true
# the whole ___domain of pbs might not be needed
DELETE pbs 2>/dev/null || true
# the next one is a STRANGE NAME with an empty dot at the end
DELETE com.sonorissoftware. 2>/dev/null || true
DELETE com.apple.imservice.ids.iMessage 2>/dev/null || true
#-----------------------------------------------------------#
# AppStore #
#-----------------------------------------------------------#
for SOME_DOMAIN in AppStore appstore ; do
for DISABLE_KEY in UserSetAutoPlayVideoSetting NSQuitAlwaysKeepsWindows ; do
DISABLE ${PPDOM}.${SOME_DOMAIN} ${DISABLE_KEY}
done ;
# WARNING: This section is required as is. DO NOT MODIFY.
#Some users might want these two disabled
for DEV_KEY in WebKitDeveloperExtras ; do
ENFORCE_DEV_MODE ${PPDOM}.${SOME_DOMAIN} ${DEV_KEY} YES
done ;
for DEBUG_KEY in ShowDebugMenu ; do
ENFORCE_DEBUG_MODE ${PPDOM}.${SOME_DOMAIN} ${DEBUG_KEY} YES
done ;
WRITE ${PPDOM}.${SOME_DOMAIN} AutoPlayVideoSetting -string off
WRITE ${PPDOM}.${SOME_DOMAIN} lastBootstrapTimeZone -string "${TZ}"
WRITE ${PPDOM}.${SOME_DOMAIN} NSNavLastRootDirectory -string "${DEFAULT_SAVE_LOCATION}"
WRITE ${PPDOM}.${SOME_DOMAIN} mostRecentTabIdentifier -string updates
WRITE ${PPDOM}.${SOME_DOMAIN} lastBootstrapDate -float "${CURRENT_SECONDS}"
DELETE ${PPDOM}.${SOME_DOMAIN} "MetricsSamplingLotteryWindowStart_pageRender" 2>/dev/null || true
done ;
#-----------------------------------------------------------#
# commerce #
#-----------------------------------------------------------#
DISABLE ${PPDOM}.commerce AutoUpdate
#-----------------------------------------------------------#
# SoftwareUpdate #
#-----------------------------------------------------------#
# WARNING: This setting is required as is. DO NOT MODIFY.
ENABLE ${PPDOM}.SoftwareUpdate AutomaticCheckEnabled
# WARNING: This setting is required as is. DO NOT MODIFY.
# Check for software updates daily, not just once per week
WRITE ${PPDOM}.SoftwareUpdate ScheduleFrequency -int 1
# WARNING: This setting is required as is. DO NOT MODIFY.
# Install System data files & security updates
WRITE ${PPDOM}.SoftwareUpdate CriticalUpdateInstall -int 1
# WARNING: This setting is required as is. DO NOT MODIFY.
# Download newly available updates in background
WRITE com.apple.SoftwareUpdate AutomaticDownload -int 1
# WARNING: This setting is required as is. DO NOT MODIFY.
# Disable Automatically download apps purchased on other Macs
WRITE ${PPDOM}.SoftwareUpdate ConfigDataInstall -int 0
# Turn on app auto-update
ENABLE ${PPDOM}.commerce AutoUpdate
# Allow the App Store to reboot machine on macOS updates
ENFORCE_DEV_MODE ${PPDOM}.commerce AutoUpdateRestartRequired NO
(softwareupdate --list 2>/dev/null || true ) &
#-----------------------------------------------------------#
# NSGlobalDomain + Apple Global Domain #
#-----------------------------------------------------------#
# Set language and text formats
for SOME_DOMAIN in NSGlobalDomain "Apple Global Domain" ; do
# Automatic show scrollbars
WRITE "${SOME_DOMAIN}" AppleShowScrollBars -string "Automatic"
# Possible values: `WhenScrolling`, `Automatic` and `Always`
WRITE "${SOME_DOMAIN}" NSTableViewDefaultSizeMode -int 2
if [[ ("${USE_DEVELOPER_SETUP}" == "YES") ]] ; then
# Increase window resize speed for Cocoa applications
WRITE "${SOME_DOMAIN}" NSWindowResizeTime -float 0.001
WRITE "${SOME_DOMAIN}" AppleAccentColor -int 3
WRITE "${SOME_DOMAIN}" AppleHighlightColor -string "0.752941 0.964706 0.678431 Green"
DELETE "${SOME_DOMAIN}" AppleInterfaceStyleSwitchesAutomatically 2>/dev/null || true
WRITE "${SOME_DOMAIN}" AppleInterfaceStyle -string "Dark"
# Set a blazingly fast keyboard repeat rate
WRITE "${SOME_DOMAIN}" KeyRepeat -int 1
WRITE "${SOME_DOMAIN}" InitialKeyRepeat -int 10
else
WRITE "${SOME_DOMAIN}" AppleAccentColor -int 2
WRITE "${SOME_DOMAIN}" AppleHighlightColor -string "1.000000 0.874510 0.701961 Orange"
if [[ ("${USE_FANCY_GRAPHICS}" == "YES") ]] ; then
# Allow window resize animation for Cocoa applications
DELETE "${SOME_DOMAIN}" NSWindowResizeTime 2>/dev/null || true
DELETE "${SOME_DOMAIN}" AppleInterfaceStyle 2>/dev/null || true
ENABLE "${SOME_DOMAIN}" AppleInterfaceStyleSwitchesAutomatically
# Set a 'normal' fast (max by gui) keyboard repeat rate
WRITE "${SOME_DOMAIN}" KeyRepeat -int 2
WRITE "${SOME_DOMAIN}" InitialKeyRepeat -int 15
DELETE "${SOME_DOMAIN}" com.apple.springing.delay
else
WRITE "${SOME_DOMAIN}" NSWindowResizeTime -float 0.01
DELETE "${SOME_DOMAIN}" AppleInterfaceStyleSwitchesAutomatically 2>/dev/null || true
WRITE "${SOME_DOMAIN}" AppleInterfaceStyle -string "Light"
# Set a fast keyboard repeat rate
WRITE "${SOME_DOMAIN}" KeyRepeat -int 1
WRITE "${SOME_DOMAIN}" InitialKeyRepeat -int 12
WRITE "${SOME_DOMAIN}" com.apple.springing.delay -float 0
fi
fi
# WARNING: The setting for AppleShowAllExtensions is required as is. DO NOT MODIFY.
# Expand save panel by default
# Expand print panel by default
for ENABLE_KEY in NSNavPanelExpandedStateForSaveMode NSNavPanelExpandedStateForSaveMode2 PMPrintingExpandedStateForPrint PMPrintingExpandedStateForPrint2 AppleShowAllExtensions ; do
ENABLE "${SOME_DOMAIN}" ${ENABLE_KEY}
done ;
# WARNING: This setting for com.apple.swipescrolldirection and AppleMetricUnits is required as is. DO NOT MODIFY.
# Disable smart quotes as they’re annoying when typing code
# Disable auto-correct
# Disable "Natural" (Lion-Style) Scrolling
for DISABLE_KEY in NSDocumentSaveNewDocumentsToCloud NSAutomaticCapitalizationEnabled NSAutomaticDashSubstitutionEnabled NSAutomaticPeriodSubstitutionEnabled NSAutomaticQuoteSubstitutionEnabled NSAutomaticSpellingCorrectionEnabled com.apple.swipescrolldirection AppleMetricUnits ; do
DISABLE "${SOME_DOMAIN}" ${DISABLE_KEY}
done ;
# WARNING: This setting is required as is. DO NOT MODIFY.
WRITE "${SOME_DOMAIN}" RetriesUntilHint -int 0
WRITE "${SOME_DOMAIN}" com.apple.mouse.tapBehavior -int 0
# WARNING: This setting is required as is. DO NOT MODIFY.
ENABLE "${SOME_DOMAIN}" com.apple.trackpad.enableSecondaryClick
WRITE "${SOME_DOMAIN}" AppleLanguages -array "${LANG}" "${LANG:0:2}"
WRITE "${SOME_DOMAIN}" NSLinguisticDataAssetsRequested -array "${LANG}" "${LANG:0:2}"
WRITE "${SOME_DOMAIN}" NSLinguisticDataAssetsRequestTime -date "${CURRENT_DATE_TIME}"
WRITE "${SOME_DOMAIN}" AppleLocale -string "${LANG}"
# WARNING: This setting is required as is. DO NOT MODIFY.
WRITE "${SOME_DOMAIN}" AppleMeasurementUnits -string "Inches"
WRITE "${SOME_DOMAIN}" AppleTemperatureUnit -string "Fahrenheit"
# Enable subpixel font rendering on non-Apple LCDs (requires restart)
# Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
# for true-tone Retnia display use 4 (to prevent flickering)
WRITE "${SOME_DOMAIN}" AppleFontSmoothing -int 4
# WARNING: This setting for com.apple.springing.enabled is required as is. DO NOT MODIFY.
# Allow the over-the-top focus ring animation when using fancy graphics
# Allow smooth scrolling
# Enable spring loading for directories
for DEV_KEY in com.apple.springing.enabled NSUseAnimatedFocusRing NSScrollAnimationEnabled ; do
ENFORCE_GRAPHICS_MODE "${SOME_DOMAIN}" ${DEV_KEY} YES
done ;
# DEV MODE
# Disable automatic termination of inactive apps
#add NSDisableAutomaticTermination to DEV_KEYs
# WARNING: This setting is required as is. DO NOT MODIFY.
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
#WRITE "${SOME_DOMAIN}" AppleKeyboardUIMode -int 3
# WARNING: This setting is required as is. DO NOT MODIFY.
for DEV_KEY in WebKitDeveloperExtras ; do
ENFORCE_DEV_MODE "${SOME_DOMAIN}" ${DEV_KEY} YES
done ;
# WARNING: This setting is required as is. DO NOT MODIFY.
# Display ASCII control characters using caret notation in standard text views
# Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
for DEBUG_KEY in NSTextShowsControlCharacters ; do
ENFORCE_DEBUG_MODE "${SOME_DOMAIN}" ${DEBUG_KEY} YES
done ;
# WARNING: This setting for ApplePressAndHoldEnabled is required as is. DO NOT MODIFY.
# Disable automatic capitalization as it’s annoying when typing code
# Disable press-and-hold for keys in favor of key repeat
for DEV_KEY in NSAutomaticCapitalizationEnabled NSAutomaticDashSubstitutionEnabled NSAutomaticPeriodSubstitutionEnabled ApplePressAndHoldEnabled ; do
ENFORCE_DEV_MODE "${SOME_DOMAIN}" ${DEV_KEY} NO
done ;
# Clean up some
DELETE "${SOME_DOMAIN}" NSNavRecentPlaces 2>/dev/null || true
done ;
WRITE Apple\ Global\ Domain AppleLanguagesDidMigrate -string "${OS_VERSION}"
#-----------------------------------------------------------#
# Finder #
#-----------------------------------------------------------#
WRITE ${PPDOM}.finder CopyProgressWindowLocation -string "{127, 127}"
WRITE ${PPDOM}.finder EmptyTrashProgressWindowLocation -string "{256, 127}"
# WARNING: This section is required as is. DO NOT MODIFY.
#Disable warnings
for DEV_KEY in FXEnableExtensionChangeWarning WarnOnEmptyTrash ; do
ENFORCE_DEV_MODE ${PPDOM}.finder ${DEV_KEY} NO
done ;
# WARNING: This section is required as is. DO NOT MODIFY.
# Finder: show hidden files in Finder by default
for A_DEV_KEY in AppleShowAllFiles ; do
ENFORCE_DEV_MODE ${PPDOM}.finder ${A_DEV_KEY} YES
done ;
# WARNING: This section is required as is. DO NOT MODIFY.
# Allow window animations and Get Info animations despite graphics mode
DISABLE "${SOME_DOMAIN}" DisableAllAnimations
if [[ ($HAS_CLOUD_ID == "YES") ]] ; then
ENABLE ${PPDOM}.finder FXICloudLoggedIn
fi
# WARNING: This section is required as is. DO NOT MODIFY.
# Show icons for hard drives, servers, and removable media on the desktop
# show all filename extensions
# show status bar
# show path bar
for ENABLE_KEY in ShowExternalHardDrivesOnDesktop ShowHardDrivesOnDesktop ShowMountedServersOnDesktop ShowRemovableMediaOnDesktop AppleShowAllExtensions ShowStatusBar ShowPathbar _FXShowPosixPathInTitle _FXSortFoldersFirst OpenWindowForNewRemovableDisk ; do
ENABLE ${PPDOM}.finder ${ENABLE_KEY}
done ;
for DISABLE_KEY in FXICloudDriveDeclinedUpgrade FXICloudDriveDesktop FXICloudDriveDocuments FXICloudDriveEnabled FXICloudDriveFirstSyncDownComplete ; do
if [[ ($HAS_CLOUD_ID == "YES") ]] ; then
DISABLE ${PPDOM}.finder ${DISABLE_KEY}
else
DELETE ${PPDOM}.finder ${DISABLE_KEY} 2>/dev/null || true
fi
done ;
# WARNING: This setting is required as is. DO NOT MODIFY.
# When performing a search, search the current folder by default
WRITE com.apple.finder FXDefaultSearchScope -string "SCcf"
# WARNING: This setting is required as is. DO NOT MODIFY.
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
WRITE com.apple.finder FXPreferredViewStyle -string "Nlsv"
for BAD_KEY in TrashViewSettings FXRecentFolders RecentMoveAndCopyDestinations SGTRecentFileSearches "PreferencesWindow.LastSelection" ; do
DELETE ${PPDOM}.finder ${BAD_KEY} 2>/dev/null || true
done ;
# MESSY FINDER SETTINGS
# Expand the following File Info panes:
# “General”, “Open with”, and “Sharing & Permissions”
WRITE ${PPDOM}.finder FXInfoPanesExpanded -dict \
Comments -bool YES \
General -bool YES \
MetaData -bool YES \
Name -bool NO \
OpenWith -bool NO \
Preview - bool NO \
Privileges -bool YES
WRITE ${PPDOM}.finder "NSToolbar Configuration Browser" -dict \
"TB Default Item Identifiers" '( "com.apple.finder.BACK", NSToolbarSpaceItem, "com.apple.finder.PATH", NSToolbarFlexibleSpaceItem, "com.apple.finder.ACTN", NSToolbarFlexibleSpaceItem, "com.apple.finder.SWCH", "com.apple.finder.ARNG", "com.apple.finder.SHAR", NSToolbarFlexibleSpaceItem, "com.apple.finder.INFO", "com.apple.finder.SRCH", "com.apple.finder.EJCT" )' \
"TB Display Mode" -int 2 \
"TB Icon Size Mode" -int 1 \
"TB Is Shown" -bool YES \
"TB Item Identifiers" '( "com.apple.finder.BACK", NSToolbarSpaceItem, "com.apple.finder.PATH", NSToolbarFlexibleSpaceItem, "com.apple.finder.ACTN", NSToolbarFlexibleSpaceItem, "com.apple.finder.SWCH", "com.apple.finder.ARNG", "com.apple.finder.SHAR", NSToolbarFlexibleSpaceItem, "com.apple.finder.INFO", "com.apple.finder.SRCH", "com.apple.finder.EJCT" )' \
"TB Size Mode" -int 1
FINDER_PLIST_PATH="${HOME:-"/Users/Shared"}/Library/Preferences/com.apple.finder.plist"
for VIEW_DOMAIN in DesktopViewSettings FK_StandardViewSettings StandardViewSettings ; do
for VIEW_MODE in "ExtendedListViewSettingsV2:sortColumn" "GalleryViewSettings:arrangeBy" "IconViewSettings:arrangeBy" "ListViewSettings:sortColumn" ; do
# Enable snap-to-grid for icons on the desktop and in other icon views
PlistBuddy -c "Set :$VIEW_DOMAIN:$VIEW_MODE kind" "${FINDER_PLIST_PATH}" 2>/dev/null || true ;
done ;
for VTEXT_SIZE in "ExtendedListViewSettingsV2:textSize" "GalleryViewSettings:textSize" "IconViewSettings:textSize" "ListViewSettings:textSize" ; do
PlistBuddy -c "Set :$VIEW_DOMAIN:$VTEXT_SIZE 14" "${FINDER_PLIST_PATH}" 2>/dev/null || true ;
done ;
PlistBuddy -c "Set :$VIEW_DOMAIN:$IconViewSettings:showItemInfo true" "${FINDER_PLIST_PATH}" 2>/dev/null || true ;
done ;
# WARNING: This section is required as is. DO NOT MODIFY.
# Set Desktop as the default ___location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
# values are "PfLo" and "PfDe"
WRITE ${PPDOM}.finder NewWindowTarget -string "PfLo"
WRITE ${PPDOM}.finder NewWindowTargetPath -string "file://${HOME}/"
#-----------------------------------------------------------#
# CrashReporter #
#-----------------------------------------------------------#
if [[ ("${USE_DEVELOPER_SETUP}" == "NO") ]] ; then
# Disable the crash reporter
WRITE ${PPDOM}.CrashReporter DialogType -string "none"
else
WRITE ${PPDOM}.CrashReporter DialogType -string "full"
fi
#-----------------------------------------------------------#
# DiskUtility #
#-----------------------------------------------------------#
# WARNING: This section is required as is. DO NOT MODIFY.
for ENABLE_KEY in DUDebugMenuEnabled advanced-image-options ; do
ENFORCE_DEV_MODE ${PPDOM}.DiskUtility ${ENABLE_KEY} YES
done ;
#-----------------------------------------------------------#
# Spotlight #
#-----------------------------------------------------------#
# WARNING: This section is required as is. DO NOT MODIFY.
WRITE ${PPDOM}.Spotlight orderedItems -array \
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
'{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
'{"enabled" = 1;"name" = "DIRECTORIES";}' \
'{"enabled" = 1;"name" = "PDF";}' \
'{"enabled" = 1;"name" = "FONTS";}' \
'{"enabled" = 1;"name" = "DOCUMENTS";}' \
'{"enabled" = 0;"name" = "MESSAGES";}' \
'{"enabled" = 0;"name" = "CONTACT";}' \
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
'{"enabled" = 1;"name" = "IMAGES";}' \
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
'{"enabled" = 0;"name" = "MUSIC";}' \
'{"enabled" = 0;"name" = "MOVIES";}' \
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
'{"enabled" = 0;"name" = "SOURCE";}' \
'{"enabled" = 1;"name" = "MENU_DEFINITION";}' \
'{"enabled" = 0;"name" = "MENU_OTHER";}' \
'{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
'{"enabled" = 1;"name" = "MENU_EXPRESSION";}' \
'{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
'{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
#-----------------------------------------------------------#
# corespotlightui #
#-----------------------------------------------------------#
DELETE ${PPDOM}.corespotlightui 2>/dev/null || true
WRITE ${PPDOM}.corespotlightui CSReceiverBundleIdentifierState -dict\
com.apple.CloudDocs.MobileDocumentsFileProvider -bool YES\
com.apple.Notes -bool YES\
com.apple.Safari -bool YES\
com.apple.fileprovider.fileproviderd -bool YES\
com.apple.iCal -bool YES\
com.apple.reminders -bool YES ;
# Load new settings before rebuilding the index
killall mds 2>/dev/null || true
#-----------------------------------------------------------#
# Bluetooth Security Settings from .macrc #
#-----------------------------------------------------------#
# Disables the sending of diagnostic data to Apple
DISABLE ~/Library/Preferences/ByHost/com.apple.SubmitDiagInfo.$HW_UUID AutoSubmit
if [[ ($USE_BLUETOOTH == "NO") ]] ; then
# Forbid Bluetooth devices to wake the computer
DISABLE ~/Library/Preferences/ByHost/com.apple.Bluetooth.$HW_UUID RemoteWakeEnabled
else
ENABLE ~/Library/Preferences/ByHost/com.apple.Bluetooth.$HW_UUID RemoteWakeEnabled
# Increase sound quality for Bluetooth headphones/headsets
WRITE com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 32
fi
#-----------------------------------------------------------#
# security.cloudkeychainproxy3.keysToRegister #
#-----------------------------------------------------------#
# iCloud 2FA settings
if [[ ($HAS_CLOUD_ID == "YES") ]] ; then
WRITE ${PPDOM}.security.cloudkeychainproxy3.keysToRegister DSID -string ${CLOUD_ID}
ENABLE ${PPDOM}.security.cloudkeychainproxy3.keysToRegister EnsurePeerRegistration
else
DISABLE ${PPDOM}.security.cloudkeychainproxy3.keysToRegister EnsurePeerRegistration
fi
# DANGER: these can lock you out of your accounts if altered
#for ARRAY_KEY in FirstUnlockKeys PendingKeys SyncBackupPeerIDs SyncPeerIDs UnlockedKeys ; #do
# WRITE ${PPDOM}.security.cloudkeychainproxy3.keysToRegister ${ARRAY_KEY} -array
#done ;
#-----------------------------------------------------------#
# systemuiserver #
#-----------------------------------------------------------#
for ENABLE_KEY in Siri com.apple.menuextra.TimeMachine com.apple.menuextra.airport com.apple.menuextra.appleuser com.apple.menuextra.battery com.apple.menuextra.bluetooth com.apple.menuextra.clock com.apple.menuextra.volume com.apple.menuextra.displays ; do
ENABLE ${PPDOM}.systemuiserver "NSStatusItem Visible ${ENABLE_KEY}"
done ;
DISABLE ${PPDOM}.systemuiserver "NSStatusItem Visible Siri"
WRITE ${PPDOM}.systemuiserver "last-analytics-stamp" -float ${CURRENT_SECONDS}
MENU_EXTRA_PATH="/System/Library/CoreServices/Menu Extras"
WRITE ${PPDOM}.systemuiserver menuExtras -array "${MENU_EXTRA_PATH}/User.menu" "${MENU_EXTRA_PATH}/Clock.menu" "${MENU_EXTRA_PATH}/Battery.menu" "${MENU_EXTRA_PATH}/Volume.menu" "${MENU_EXTRA_PATH}/AirPort.menu" "${MENU_EXTRA_PATH}/Bluetooth.menu" "${MENU_EXTRA_PATH}/TimeMachine.menu" "${MENU_EXTRA_PATH}/Displays.menu"
#-----------------------------------------------------------#
# universalaccess #
#-----------------------------------------------------------#
for DISABLE_KEY in closeViewScrollWheelToggle closeViewHotkeysEnabled closeViewZoomDisplayID login ; do
DISABLE ${PPDOM}.universalaccess ${DISABLE_KEY}
done ;
# Allow transparency in the menu bar and elsewhere on Yosemite when using fancy graphics
ENFORCE_GRAPHICS_MODE ${PPDOM}.universalaccess reduceTransparency NO
ENABLE ${PPDOM}.universalaccess closeViewZoomFactor
#-----------------------------------------------------------#
# frameworks.diskimages #
#-----------------------------------------------------------#
# WARNING: This setting is required as is. DO NOT MODIFY.
DISABLE ${PPDOM}.frameworks.diskimages "skip-verify"
# WARNING: This section is required as is. DO NOT MODIFY.
for ENABLE_KEY in "auto-open-ro-root" "auto-open-rw-root" "skip-verify-locked" "skip-verify-remote" ; do
ENABLE ${PPDOM}.frameworks.diskimages ${ENABLE_KEY}
done ;
ENFORCE_DEV_MODE ${PPDOM}.frameworks.diskimages OpenWindowForNewRemovableDisk NO
#-----------------------------------------------------------#
# Preferences #
#-----------------------------------------------------------#
WRITE ${PPDOM}.Preferences UserDictionaryImportedSinceMaintenance -int 0
WRITE ${PPDOM}.Preferences UserDictionaryLastMaintenanceDate -date "${CURRENT_DATE_TIME}"
WRITE ${PPDOM}.Preferences UserDictionaryLocalPeerIdentityCurrent -string "${LOGNAME:-${USER}}~${HW_UUID}"
#-----------------------------------------------------------#
# SystemPreferences #
#-----------------------------------------------------------#
if [[ ( -d "${HOME}/Pictures/Wedding Desktops" ) ]] ; then
WRITE ${PPDOM}.systempreferences DSKDesktopPrefPane -dict UserFolderPaths '("${HOME}/Pictures/Wedding Desktops")'
fi
for STRING_KEY in NSNavLastRootDirectory com.apple.TimeMachine.OpenPanelDirectory ; do
WRITE ${PPDOM}.systempreferences ${STRING_KEY} -string "${DEFAULT_SAVE_LOCATION}"
done ;
# REQUIRED SECURITY SETTING
# Disable Resume system-wide
DISABLE ${PPDOM}.systempreferences NSQuitAlwaysKeepsWindows
for BAD_KEY in com.apple.dtandsspref.lastselectedtab com.apple.preference.keyboard.lastselectedtab trackpad.lastselectedtab ; do
DELETE ${PPDOM}.systempreferences ${BAD_KEY} 2>/dev/null || true
done ;
#-----------------------------------------------------------#
# Preferences.Extensions #
#-----------------------------------------------------------#
for SOME_DOMAIN in PhotoEditing PhotoProjects QuickLook XcodeSourceEditor SharedLinks ServicesWithUI ShareMenu ; do
ENABLE ${PPDOM}.Preferences.Extensions.${SOME_DOMAIN} userHasOrdered
done ;
for SOME_DOMAIN in PhotoProjects SharedLinks XcodeSourceEditor ; do
WRITE ${PPDOM}.Preferences.Extensions.${SOME_DOMAIN} displayOrder -array
done ;
WRITE ${PPDOM}.Preferences.Extensions.PhotoEditing displayOrder -array "com.apple.MarkupUI.MarkupPhotoExtension"
WRITE ${PPDOM}.Preferences.Extensions.QuickLook displayOrder -array "com.apple.reminders.quicklookextension"
WRITE ${PPDOM}.Preferences.Extensions.ServicesWithUI displayOrder -array "com.apple.MarkupUI.Markup"
WRITE ${PPDOM}.Preferences.Extensions.ShareMenu displayOrder -array "com.apple.Notes.SharingExtension" "com.apple.share.AirDrop.send" "com.apple.share.System.add-to-safari-reading-list" "com.apple.reminders.sharingextension" "com.apple.share.Mail.compose" "com.apple.messages.ShareExtension" "com.apple.share.System.add-to-iphoto" "com.apple.share.CloudSharing.invite" "com.apple.iBooksX.SharingExtension"
#-----------------------------------------------------------#
# preferences.screentime #
#-----------------------------------------------------------#
if [[ ($HAS_CLOUD_ID == "YES") ]] ; then
ENABLE ${PPDOM}.preferences.screentime HasBeenIntroduced
WRITE ${PPDOM}.preferences.screentime HasShownCommunicationLimitsCompatibilityAlertByDSID -dict-add ${CLOUD_ID} 1
else
DISABLE ${PPDOM}.preferences.screentime HasBeenIntroduced
fi
#-----------------------------------------------------------#
# knowledge-agent #
#-----------------------------------------------------------#
DISABLE knowledge-agent ScreenTimeSyncDisabled
#-----------------------------------------------------------#
# Terminal #
#-----------------------------------------------------------#
# Only use UTF-8 in Terminal.app
# DISABLE “focus follows mouse” for Terminal.app and all X11 apps
# i.e. hover over a window and start typing in it without clicking first
# ensure bash is used (not the zsh junk)
# Enable Secure Keyboard Entry in Terminal.app
# See: https://security.stackexchange.com/a/47786/8918
# Disable the annoying line marks
# WARNING: This setting for StringEncodings, ShowLineMarks and SecureKeyboardEntry is required as is. DO NOT MODIFY.
for SOME_DOMAIN in terminal Terminal ; do
# Only use UTF-8 in Terminal.app
WRITE ${PPDOM}.${SOME_DOMAIN} StringEncodings -array 4 30
WRITE ${PPDOM}.${SOME_DOMAIN} Shell -string $(command -v bash)" -il" ;
ENABLE ${PPDOM}.${SOME_DOMAIN} SecureKeyboardEntry
WRITE ${PPDOM}.${SOME_DOMAIN} ShowLineMarks -int 0
DISABLE ${PPDOM}.${SOME_DOMAIN} FocusFollowsMouse
done ;
#-----------------------------------------------------------#
# X11 #
#-----------------------------------------------------------#
# WARNING: This setting is required as is. DO NOT MODIFY.
# disable remote X11 socket
ENABLE org.x.X11 nolisten_tcp
DELETE org.x.X11 wm_ffm 2>/dev/null || true
#-----------------------------------------------------------#
# ActivityMonitor #
#-----------------------------------------------------------#
# WARNING: This setting is required as is. DO NOT MODIFY.
# Show the main window when launching Activity Monitor
ENABLE ${PPDOM}.ActivityMonitor OpenMainWindow
WRITE ${PPDOM}.ActivityMonitor ShowCategory -int 0
if [[ ("${USE_FANCY_GRAPHICS}" == "YES") ]] ; then
# Visualize CPU usage in the Activity Monitor Dock icon
WRITE ${PPDOM}.ActivityMonitor IconType -int 5
fi
# WARNING: This setting is required as is. DO NOT MODIFY.
# Show all processes in Activity Monitor
WRITE ${PPDOM}.ActivityMonitor ShowCategory -int 0
# WARNING: This section is required as is. DO NOT MODIFY.
# Sort Activity Monitor results by CPU usage
WRITE ${PPDOM}.ActivityMonitor SortColumn -string "CPUUsage"
WRITE ${PPDOM}.ActivityMonitor SortDirection -int 0
#-----------------------------------------------------------#
# AdLib #
#-----------------------------------------------------------#
#ensures only one key
DELETE ${PPDOM}.AdLib 2>/dev/null || true
ENABLE ${PPDOM}.AdLib forceLimitAdTracking
#-----------------------------------------------------------#
# AdGuard #
#-----------------------------------------------------------#
WRITE com.adguard.safari.AdGuard NSTreatUnknownArgumentsAsOpen -string NO
#-----------------------------------------------------------#
# NetworkBrowser #
#-----------------------------------------------------------#
# WARNING: This section is required as is. DO NOT MODIFY.
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
for ENABLE_KEY in BrowseAllInterfaces ; do
ENABLE ${PPDOM}.NetworkBrowser ${ENABLE_KEY}
done ;
if [[ ("${USE_BLUETOOTH}" == "YES") ]] ; then
for DISABLE_KEY in DisableAirDrop ; do
DISABLE ${PPDOM}.NetworkBrowser ${DISABLE_KEY}
done ;
else
for ENABLE_KEY in DisableAirDrop ; do
ENABLE ${PPDOM}.NetworkBrowser ${ENABLE_KEY}
done ;
fi
#-----------------------------------------------------------#
# Safari #
#-----------------------------------------------------------#
#General/Security
# WARNING: This section except for ExcludePrivateWindowWhenRestoringSessionAtLaunch, LocalFileRestrictionsEnabled, and OpenPrivateWindowWhenNotRestoringSessionAtLaunch is required as is. DO NOT MODIFY.
for ENABLE_KEY in AskBeforeSubmittingInsecureForms ExcludePrivateWindowWhenRestoringSessionAtLaunch LocalFileRestrictionsEnabled OpenPrivateWindowWhenNotRestoringSessionAtLaunch SendDoNotTrackHTTPHeader SuppressSearchSuggestions TreatSHA1CertificatesAsInsecure WarnAboutFraudulentWebsites WebContinuousSpellCheckingEnabled InstallExtensionUpdatesAutomatically ; do
ENABLE ${PPDOM}.Safari ${ENABLE_KEY}
done ;
# WARNING: This section except for AlwaysRestoreSessionAtLaunch, CanPromptForPushNotifications, PreloadTopHit, and ShowFavoritesUnderSmartSearchField is required as is. DO NOT MODIFY.
for DISABLE_KEY in AlwaysRestoreSessionAtLaunch AutoFillCreditCardData AutoFillFromAddressBook AutoFillMiscellaneousForms AutoFillPasswords AutoOpenSafeDownloads CanPromptForPushNotifications PreloadTopHit ShowFavoritesBar ShowFavoritesUnderSmartSearchField WebAutomaticSpellingCorrectionEnabled UniversalSearchEnabled ShowSidebarInTopSites ; do
DISABLE ${PPDOM}.Safari ${DISABLE_KEY}
done ;
# WARNING: This section except for IncludeInternalDebugMenu is required as is. DO NOT MODIFY.
for ENABLE_KEY in IncludeDevelopMenu ShowFullURLInSmartSearchField ; do
ENFORCE_DEV_MODE ${PPDOM}.Safari ${ENABLE_KEY} YES
done ;
for ENABLE_DEBUG_KEY in IncludeInternalDebugMenu WebKitDeveloperExtrasEnabledPreferenceKey com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled ; do
ENFORCE_DEBUG_MODE ${PPDOM}.Safari ${ENABLE_DEBUG_KEY} YES
done ;
# WARNING: This setting is required as is. DO NOT MODIFY.
ENFORCE_DEV_MODE ${PPDOM}.Safari FindOnPageMatchesWordStartsOnly NO
#WebKits
# WARNING: This section except for com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled is required as is. DO NOT MODIFY.
for ENABLE_KEY in WebKitTabToLinksPreferenceKey com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled ; do
ENABLE ${PPDOM}.Safari ${ENABLE_KEY}
done ;
# WARNING: This section is required as is. DO NOT MODIFY.
for DISABLE_KEY in WebKitPluginsEnabled com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled WebKitJavaEnabled com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled WebKitJavaScriptCanOpenWindowsAutomatically com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically ; do
DISABLE ${PPDOM}.Safari ${DISABLE_KEY}
done ;
# WARNING: This section is required as is. DO NOT MODIFY.
for SOME_DOMAIN in Safari SafariTechnologyPreview ; do
for DISABLE_KEY in WebKitMediaPlaybackAllowsInline com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback ; do
DISABLE ${PPDOM}.${SOME_DOMAIN} ${DISABLE_KEY}
done ;
done ;
for INT_KEY in NewTabBehavior NewWindowBehavior ; do
WRITE ${PPDOM}.Safari ${INT_KEY} -int 1
done ;
for ARRAY_KEY in OpenWindows ProxiesInBookmarksBar RecentWebSearches ; do
WRITE ${PPDOM}.Safari ${ARRAY_KEY} -array
done ;
WRITE ${PPDOM}.Safari LastOSVersionSafariWasLaunchedOn -string "${OS_VERSION}"
WRITE ${PPDOM}.Safari NSNavLastRootDirectory -string "~/Downloads"
WRITE ${PPDOM}.Safari HomePage -string "https://duckduckgo.com/?kn=1&k1=-1&kap=-1&kaq=-1&kax=-1&kak=-1&kt=Tuffy&kae=d&kw=s&k7=3e3e3e&kj=1e1e1e&k9=ffffff"
WRITE ${PPDOM}.Safari SearchProviderIdentifier -string "com.duckduckgo"
WRITE ${PPDOM}.Safari HistoryAgeInDaysLimit -int 8
# WARNING: This setting is required as is. DO NOT MODIFY.
# Disable Safari’s thumbnail cache for History and Top Sites
# WRITE com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
#Some users want this setting
#DELETE ${PPDOM}.Safari IncludeInternalDebugMenu 2>/dev/null || true
#-----------------------------------------------------------#
# SafariBookmarksSyncAgent #
#-----------------------------------------------------------#
#-----------------------------------------------------------#
# AppStoreDamon #
#-----------------------------------------------------------#
if [[ ($HAS_CLOUD_ID == "YES") ]] ; then
WRITE ${PPDOM}.appstored ArcadeDeviceGUID -string ${CLOUD_ID}
fi
WRITE ${PPDOM}.appstored ArcadeDeviceID -string "${ZERO_UUID}"
WRITE ${PPDOM}.appstored ArcadeDeviceIDCreationDate -date "2020-11-11 11:11:11 +0000"
WRITE ${PPDOM}.appstored ArcadePayoutDeviceID -string "${ZERO_UUID}"
WRITE ${PPDOM}.appstored ArcadeSubscriptionState -string Unsubscribed
# this needs to be moved to user prefs
# WRITE ${PPDOM}.appstored WelcomeNotificationLastAppStoreConnectionProductVersion -string "${OS_VERSION}"
#-----------------------------------------------------------#
# Preview #
#-----------------------------------------------------------#
if [[ ($HAS_CLOUD_ID == "YES") ]] ; then
WRITE ${PPDOM}.Preview PVGeneralUserName -string "${CLOUD_UN}"
else
WRITE ${PPDOM}.Preview PVGeneralUserName -string "${USERNAME}"
fi
WRITE ${PPDOM}.Preview kPVPDFDefaultPageViewModeOption -int 0
#-----------------------------------------------------------#
# AddressBook #
#-----------------------------------------------------------#
for SOME_DOMAIN in AddressBook addressbook ; do
for ENABLE_KEY in ABBirthDayVisible ABJobTitleVisible ABNicknameVisible ABRelatedRecordsVisible ; do
ENABLE ${PPDOM}.${SOME_DOMAIN} ${ENABLE_KEY}
done ;
# WARNING: This setting is required as is. DO NOT MODIFY.
ENFORCE_DEV_MODE ${PPDOM}.${SOME_DOMAIN} ABShowDebugMenu YES
WRITE ${PPDOM}.${SOME_DOMAIN} ABInitialLabelsAddress -array $'"_$!<Work>!$_"'
WRITE ${PPDOM}.${SOME_DOMAIN} ABInitialLabelsEmail -array $'"_$!<Personal>!$_"' $'"_$!<Work>!$_"'
WRITE ${PPDOM}.${SOME_DOMAIN} ABInitialLabelsPhone -array $'"_$!<Home>!$_"'
WRITE ${PPDOM}.${SOME_DOMAIN} ABInitialLabelsRelatedRecords -array $'"_$!<Spouse>!$_"'
WRITE ${PPDOM}.${SOME_DOMAIN} ABInitialLabelsURLs -array $'"_$!<HomePage>!$_"'
DISABLE ${PPDOM}.${SOME_DOMAIN} ABInstantMessagesVisible
DELETE ${PPDOM}.${SOME_DOMAIN} "NSSplitView Subview Frames ABCleanWindowController-MainCleanWindow" 2>/dev/null || true
DELETE ${PPDOM}.${SOME_DOMAIN} ABCleanWindowController-MainCleanWindow-personListController 2>/dev/null || true