-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.osx109
executable file
·1206 lines (928 loc) · 93.1 KB
/
.osx109
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
default='\033[0;39m'
hidefault='\033[0;30;39m'
white='\033[0;37m'
hiwhite='\033[0;30;47m'
red='\033[0;31m'
hired='\033[0;30;31m'
green='\033[0;32m'
higreen='\033[1;30;32'
blue='\033[0;34m'
hiblue='\033[0;30;34m'
drkgray='\033[0;90m'
hidrkgray='\033[0;30;90m'
cyan='\033[0;36m'
hicyan='\033[0;30;36m'
magenta='\033[0;35m'
himagenta='\033[0;30;35m'
yellow='\033[0;33m'
hiyellow='\033[0;30;33m'
key='\033[0;30m'
hikey='\033[0;97;40m'
# Set graphics mode. (i) ANSI escape sequences format: \033[${textattribute};${foregroundcolor};${backgroundcolor}m (or esc[${value};...;${value}m).
off=`tput sgr0` #${capname} = 'sgr0' # Turn off _all_ attribute modes.
function cecho
{
local string="${1}"
local attributemode="${2}"
echo "${attributemode}${string}${off}"
return
} # Color Echo (João Cunha `joaocunha`) improved (Brandon Brown `brandonb927`) custom (Karl Bertin `kvpb`)
echo ''
cecho ' ^ (^) \ / /| /^\ ^ | | |' ${red}
cecho ' ( ) \ X / | | | (_) |V| /\| \ / /_\ |/\ o /^\ |_/ (_' ${red}
cecho ' . V (_) / \ | \_/ / | | \/| V \_ | | \_ | \ )' ${red}
echo ''
cecho ' LICENSED BY' ${red}
cecho ' ${LICENSOR}' ${red}
echo ''
cecho " K K V V PPP BB '" ${red}
cecho ' KK V V PPP BBB SS' ${red}
cecho ' K K V P BBB SS' ${red}
echo ''
cecho ' WARNING: USE THIS SCRIPT AT YOUR OWN RISK.' ${red}
echo ''
cecho " ALL THE COMPUTER PROGRAMS AND SOFTWARE ARE PROVIDED 'AS IS' WITHOUT WARRANTY" ${red}
cecho ' OF ANY KIND. WE MAKE NO WARRANTIES, EXPRESS OR IMPLIED, THAT THEY ARE FREE' ${red}
cecho ' OF ERROR, OR ARE CONSISTENT WITH ANY PARTICULAR STANDARD OF MERCHANTABILITY,' ${red}
cecho ' OR THAT THEY WILL MEET YOUR REQUIREMENTS FOR ANY PARTICULAR APPLICATION. THEY' ${red}
cecho ' SHOULD NOT BE RELIED ON FOR SOLVING A PROBLEM WHOSE INCORRECT SOLUTION COULD' ${red}
cecho ' RESULT IN INJURY TO A PERSON OR LOSS OF PROPERTY. IF YOU DO USE THEM' ${red}
cecho ' IN SUCH A MANNER, IT IS AT YOUR OWN RISK. THE AUTHOR AND PUBLISHER DISCLAIM' ${red}
cecho ' ALL LIABILITY FOR DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES RESULTING FROM' ${red}
cecho ' YOUR USE OF THE PROGRAMS.' ${red}
echo ''
say --voice=Fiona 'Ta-da!'
# Display the title screen with the disclaimer.
sudo -v # Ask for an administrator password.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Update the sudo timestamp until the script is over.
#osascript -e 'tell application "System Preferences" to quit' # Quit any System Preferences pane to prevent them from overriding this script.
killall System\ Preferences # Kill System Preferences.
cecho 'First-Party Settings: Systemwide And User-Specific Preferences' ${yellow}
echo 'Unnamed'
sudo spctl --master-disable #sudo defaults write /var/db/SystemPolicy-prefs.plist enabled -string NO # Allow apps downloaded from anywhere. (Disable GateKeeper.)
chsh -s /bin/bash # Set BASH as login shell.
defaults write com.apple.LaunchServices LSQuarantine -bool FALSE # Do not warn when opening an application.
#sudo pmset -a disksleep 0 # Do not put hard disks to sleep when possible. (i) A trick for Apple computers without HDD.
#sudo pmset -a sms 0 # Disable the sudden motion sensor. (i) A trick for Apple laptops without HDD.
sudo systemsetup -setrestartfreeze on # Restart automatically if the computer freezes.
defaults write -g AppleLanguages -array "en" "fr" # Set US english and FR french as preferred languages.
defaults write -g AppleLocale -string "en_US@currency=EUR" # Set US english as format language and euro as currency.
defaults write -g AppleMeasurementUnits -string "Centimeters" # Set centimeters as measurement unit.
defaults write -g AppleMetricUnits -bool TRUE
# Set the language and text formats.
systemsetup -settimezone "Europe/Paris" > /dev/null # Set the timezone. (i) See `sudo systemsetup -listtimezones` for other values.
sudo systemsetup -setusingnetworktime on # Enable network time use.
sudo systemsetup -setnetworktimeserver "time.euro.apple.com" # Set network time server.
echo 'Directory Layout'
sudo ln -s /usr/libexec/PlistBuddy /usr/bin/PlistBuddy
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/bin/airport
sudo ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /usr/bin/jsc
# Write system-wide custom symbolic links.
if [ -e "/Applications/{Directory Utility,Network Utility,Finder,Archive Utility}.app" ];
then
mv /Applications/Directory\ Utility.app ${HOME}/.Trash/
mv /Applications/Network\ Utility.app ${HOME}/.Trash/
mv /Applications/Finder.app ${HOME}/.Trash/
mv /Applications/Archive\ Utility.app ${HOME}/.Trash/
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/Directory Utility.app") at (POSIX file "/Applications")'
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/Network Utility.app") at (POSIX file "/Applications")'
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Finder.app") at (POSIX file "/Applications")'
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/Archive Utility.app") at (POSIX file "/Applications")'
else
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/Directory Utility.app") at (POSIX file "/Applications")'
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/Network Utility.app") at (POSIX file "/Applications")'
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Finder.app") at (POSIX file "/Applications")'
sudo osascript -e 'tell application "Finder" to make alias file to (POSIX file "/System/Library/CoreServices/Applications/Archive Utility.app") at (POSIX file "/Applications")'
fi
# Write system-wide custom aliases.
echo 'Network'
macmodelname=$(system_profiler SPHardwareDataType | grep "Model Name" | cut -c19-)
#echo "What is the owner of this Mac's name?"
#read userfullname
userfullname='KVPB'
sudo scutil --set ComputerName "${userfullname}'s ${macmodelname}"
sudo scutil --set HostName "${userfullname}'s ${macmodelname}"
macmodelname2=$(echo ${macmodelname} | sed 's/ //')
sudo scutil --set LocalHostName "KVPBs${macmodelname2}"
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "${userfullname}'s ${macmodelname}"
#sudo -- sh -c -e 'echo "127.0.0.1 " >> /etc/hosts'
#sudo -- sh -c -e 'echo "fe80::1%lo0 " >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 www.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 m.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 m.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 en-gb.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 fr-fr.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 login.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 login.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 www.login.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 www.login.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 fbcdn.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 fbcdn.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 www.fbcdn.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 www.fbcdn.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 fbcdn.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 fbcdn.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 www.fbcdn.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 www.fbcdn.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 static.ak.fbcdn.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 static.ak.fbcdn.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 connect.facebook.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 connect.facebook.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 www.connect.facebook.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 www.connect.facebook.net" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 static.ak.connect.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 static.ak.connect.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 apps.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "fe80::1%lo0 apps.facebook.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 twitter.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "127.0.0.1 www.twitter.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "#127.0.0.1 youtube.com" >> /etc/hosts'
sudo -- sh -c -e 'echo "#127.0.0.1 www.youtube.com" >> /etc/hosts'
sudo dscacheutil -flushcache # Clear the DNS cache. #lookupd -flushcache # Clear the DNS cache on Mac OS X 10.4 Tiger. #sudo dscacheutil -flushcache # Clear the DNS cache on Mac OS X 10.5 Leopard, 10.6 Snow Leopard. #sudo killall -HUP mDNSResponder # Clear the DNS cache on Mac OS X 10.7 Lion, 10.8 Mountain Lion. #sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder # Clear the DNS cache on OS X 10.9 Mavericks.
printf '\xF0\x9F\x9A\xAE\n'
# Put litter in its place.
echo 'Login Window & Screen Saver (NSGlobalDomain, com.apple.loginwindow, com.apple.HIToolbox.loginwindow, com.apple.screensaver)'
sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser "" # Disable automatic login.
sudo /usr/libexec/PlistBuddy -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.US" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleCurrentKeyboardLayoutInputSourceID com.apple.keylayout.US" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox dict" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Delete :com.apple.HIToolbox:AppleDefaultAsciiInputSource" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleDefaultAsciiInputSource array" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleDefaultAsciiInputSource:InputSourceKind string Keyboard\ Layout" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleDefaultAsciiInputSource:InputSourceKind Keyboard\ Layout" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleDefaultAsciiInputSource:KeyboardLayout\ ID integer ${keyboardlayoutid}" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleDefaultAsciiInputSource:KeyboardLayout\ ID ${keyboardlayoutid}" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleDefaultAsciiInputSource:KeyboardLayout\ Name string U.S." "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleDefaultAsciiInputSource:KeyboardLayout\ Name U.S." "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Delete :com.apple.HIToolbox:AppleEnabledInputSources" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleEnabledInputSources array" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleEnabledInputSources:0 dict" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleEnabledInputSources:0:InputSourceKind string Keyboard\ Layout" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleEnabledInputSources:0:InputSourceKind Keyboard\ Layout" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleEnabledInputSources:0:KeyboardLayout\ ID integer ${keyboardlayoutid}" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleEnabledInputSources:0:KeyboardLayout\ ID ${keyboardlayoutid}" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleEnabledInputSources:0:KeyboardLayout\ Name string U.S." "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleEnabledInputSources:0:KeyboardLayout\ Name U.S." "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Delete :com.apple.HIToolbox:AppleSelectedInputSources" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleSelectedInputSources array" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleSelectedInputSources:0 dict" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleSelectedInputSources:0:InputSourceKind string Keyboard\ Layout" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleSelectedInputSources:0:InputSourceKind Keyboard\ Layout" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleSelectedInputSources:0:KeyboardLayout\ ID integer ${keyboardlayoutid}" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleSelectedInputSources:0:KeyboardLayout\ ID ${keyboardlayoutid}" "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Add :com.apple.HIToolbox:AppleSelectedInputSources:0:KeyboardLayout\ Name string U.S." "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
sudo /usr/libexec/PlistBuddy -c "Set :com.apple.HIToolbox:AppleSelectedInputSources:0:KeyboardLayout\ Name U.S." "/var/tmp/com.apple.HIToolbox.loginwindow.plist"
# Add login window input keyboard layout, and set it to US.
sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool TRUE
#sudo defaults write /var/ard/Library/Preferences/com.apple.menuextra.textinput ModeNameVisible -bool TRUE
sudo chmod 777 /Library/Preferences/com.apple.loginwindow.plist
# Display Input keyboard layout menu in the login window.
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName # Display IP address, hostname, OS version etc when clicking the clock in the login window.
#echo "What is the phone number with country code of the owner of this Mac?"
#echo "(E.g. '+33 6 XX XX XX XX' for french mobile phone numbers.)"
#read phonenumber
#echo "What is the email address of the owner of this Mac?"
#read emailaddress
#sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "${userfullname}'s ${macmodelname}.\nPlease contact ${phonenumber} or ${emailaddress} if found."
# Set and display lock message. (i) userfullname and macmodelname variables have been set earlier, at Network: Computer name.
sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Karl V. P. Bertin's ${macmodelname}.\nPlease contact both +33 6 33 78 48 93 and karlvp.bertin@gmail.com if found. USD10,000.00 reward." # Display set lock message. (i) computername variable has been set earlier at Network: Computer name.
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Require password immediately after sleep or screen saver begins. (Enable Require Password Immediately After Sleep Or Screen Saver Begins.)
echo 'Keyboard (NSGlobalDomain, com.apple.HIToolbox, com.apple.universalaccess)'
sudo /usr/libexec/PlistBuddy -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.US" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleCurrentKeyboardLayoutInputSourceID com.apple.keylayout.US" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Delete :AppleDefaultAsciiInputSource" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleDefaultAsciiInputSource:InputSourceKind string Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleDefaultAsciiInputSource:InputSourceKind Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleDefaultAsciiInputSource:KeyboardLayout\ ID integer 0" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleDefaultAsciiInputSource:KeyboardLayout\ ID 0" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleDefaultAsciiInputSource:KeyboardLayout\ Name string U.S." "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleDefaultAsciiInputSource:KeyboardLayout\ Name U.S." "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Delete :AppleEnabledInputSources" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0 dict" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0:InputSourceKind string Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleEnabledInputSources:0:InputSourceKind Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0:KeyboardLayout\ ID integer 0" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleEnabledInputSources:0:KeyboardLayout\ ID 0" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0:KeyboardLayout\ Name string U.S." "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleEnabledInputSources:0:KeyboardLayout\ U.S." "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Delete :AppleSelectedInputSources" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0 dict" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0:InputSourceKind string Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleSelectedInputSources:0:InputSourceKind Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0:KeyboardLayout\ ID integer 0" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleSelectedInputSources:0:KeyboardLayout\ ID 0" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0:KeyboardLayout\ Name string U.S." "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Set :AppleSelectedInputSources:0:KeyboardLayout\ Name U.S." "/Library/Preferences/com.apple.HIToolbox.plist"
sudo chown root:admin "/Library/Preferences/com.apple.HIToolbox.plist"
sudo chmod 644 "/Library/Preferences/com.apple.HIToolbox.plist"
# Add system input keyboard layout, and set it to US.
sudo /usr/libexec/PlistBuddy -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.UnicodeHexInput" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleDefaultAsciiInputSource:InputSourceKind string Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleDefaultAsciiInputSource:KeyboardLayout\ ID integer -1" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleDefaultAsciiInputSource:KeyboardLayout\ Name string Unicode\ Hex\ Input" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0 dict" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0:InputSourceKind string Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0:KeyboardLayout\ ID integer -1" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleEnabledInputSources:0:KeyboardLayout\ Name string Unicode\ Hex\ Input" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0 dict" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0:InputSourceKind string Keyboard\ Layout" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0:KeyboardLayout\ ID integer -1" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo /usr/libexec/PlistBuddy -c "Add :AppleSelectedInputSources:0:KeyboardLayout\ Name string Unicode\ Hex\ Input" "/Library/Preferences/com.apple.HIToolbox.plist"
sudo chown root:admin "/Library/Preferences/com.apple.HIToolbox.plist"
sudo chmod 644 "/Library/Preferences/com.apple.HIToolbox.plist"
# Add Unicode hex input system input keyboard layout.
defaults write -g AppleKeyboardUIMode -int 3 # Enable full keyboard access for all controls.
defaults write -g NSUserKeyEquivalents '{Zoom = "@$m";}'
# Add Shift-Command-M 'Maximize window' keyboard app shortcut. # It doesn't work so well, e.g. in Chrome, it fully expands a window resized to 50% of the desktop's width to fill the desktop, but it doesn't just refit the window to Chrome's default size which is a bit larger.
defaults write -g ApplePressAndHoldEnabled -bool FALSE # Disable press-and-hold for keys.
defaults write -g InitialKeyRepeat -int 10 # Set even shorter key repeat triggering delay. /!\ ≤10: NS SOM PARTY MN BRAV MYLOO (i) 15: GUI fastest
defaults write -g KeyRepeat -int 1 # Set faster key repeat rate. (Enable key repeat.)
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool TRUE
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
# Use scroll gesture with Strg (⌃) modifier key to zoom. # Because back then, I had a QWERTZ Model M keyboard. Deutsche Qualität.
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool TRUE # Follow the keyboard focus while zoomed in.
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool FALSE # Disable automatic spell correction.
defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool FALSE
defaults write -g NSAutomaticDashSubstitutionEnabled -bool FALSE
# Disable smart quotes and dashes; set smart double and single quotes to defaults.
defaults write ${HOME}/Library/Preferences/.GlobalPreferences.plist NSUserDictionaryReplacementItems -array \
'{ on = 1; replace = "\\llrda"; with = "\U27fa"; }' \
'{ on = 1; replace = "\\fa"; with = "\U2200"; }' \
'{ on = 1; replace = "\\eo"; with = "\U2208"; }' \
'{ on = 1; replace = "\\naeo"; with = "\U2209"; }' \
'{ on = 1; replace = "\\N"; with = "\U2115"; }' \
'{ on = 1; replace = "\\Z"; with = "\U2124"; }' \
'{ on = 1; replace = "\\R"; with = "\U211d"; }' \
'{ on = 1; replace = "\\C"; with = "\U2102"; }' \
'{ on = 1; replace = "\\lamda"; with = "\U03bb"; }' \
'{ on = 1; replace = "\\times"; with = "\U00d7"; }' \
'{ on = 1; replace = "\\omega"; with = "\\U03c9"; }' \
'{ on = 1; replace = "\\psi"; with = "\U03c8"; }' \
'{ on = 1; replace = "\\chi"; with = "\U03c7"; }' \
'{ on = 1; replace = "\\phi"; with = "\U03c6"; }' \
'{ on = 1; replace = "\\upsilon"; with = "\U03c5"; }' \
'{ on = 1; replace = "\\tau"; with = "\U03c4"; }' \
'{ on = 1; replace = "\\sigma"; with = "\U03c3"; }' \
'{ on = 1; replace = "\\rho"; with = "\U03c1"; }' \
'{ on = 1; replace = "\\pi"; with = "\U03c0"; }' \
'{ on = 1; replace = "\\omicron"; with = "\U03bf"; }' \
'{ on = 1; replace = "\\zi"; with = "\U03be"; }' \
'{ on = 1; replace = "\\nu"; with = "\U03bd"; }' \
'{ on = 1; replace = "\\mu"; with = "\U03bc"; }' \
'{ on = 1; replace = "\\kappa"; with = "\U03ba"; }' \
'{ on = 1; replace = "\\iota"; with = "\U03b9"; }' \
'{ on = 1; replace = "\\theta"; with = "\U03b8"; }' \
'{ on = 1; replace = "\\eta"; with = "\U03b7"; }' \
'{ on = 1; replace = "\\zeta"; with = "\U03b6"; }' \
'{ on = 1; replace = "\\epsilon"; with = "\U03b5"; }' \
'{ on = 1; replace = "\\delta"; with = "\U03b4"; }' \
'{ on = 1; replace = "\\gamma"; with = "\U03b3"; }' \
'{ on = 1; replace = "\\beta"; with = "\U03b2"; }' \
'{ on = 1; replace = "\\alpha"; with = "\U03b1"; }'
# Set the text substitutions.
echo 'Mouse & Trackpad (NSGlobalDomain, com.apple.driver.AppleHIDMouse, com.apple.driver.AppleBluetoothMultitouch.trackpad, com.apple.dock)'
defaults write com.apple.driver.AppleHIDMouse.plist Button2 -int 2 # Enable mouse secondary click.
defaults -currentHost write -g com.apple.trackpad.trackpadCornerClickBehaviour -int 1
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool TRUE
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 1
defaults -currentHost write -g com.apple.trackpad.enableSecondaryClick -bool TRUE
# Enable trackpad secondary click, and set it to click or tap with two fingers. # Enter `defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2` to map bottom-right click to secondary click.
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool TRUE
defaults -currentHost write -g com.apple.mouse.tapBehavior -int 1
defaults write -g com.apple.mouse.tapBehavior -int 1
# Enable trackpad tap to click for current user and login screen.
defaults write -g com.apple.mouse.scaling -int 3 # Set mouse tracking speed to fast. (i) 0: slow; 3: fast.
#defaults write -g com.apple.scrollwheel.scaling -float 1.7 # Set mouse scroll wheel scrolling speed to fast. (i) 0: slow; 1.7: fast. /!\ seems to cause drag and drop in Finder to become slow to unresponsive.
#defaults write -g com.apple.mouse.doubleClickThreshold -float 3.8625 # Set mouse double click needed speed to 75%. /!\ seems to cause drag and drop in Finder to become slow to unresponsive.
defaults write -g com.apple.trackpad.scaling -int 3 # Set trackpad tracking speed to fast. (i) 0: slow; 3: fast.
defaults write -g com.apple.swipescrolldirection -bool TRUE # Enable natural (OS X 10.7 Lion-style) scroll direction. (Enable System Preferences: TrackPad: Scroll & Zoom: Scroll Direction: natural.)
defaults write -g AppleEnableSwipeNavigateWithScrolls -bool TRUE
defaults -currentHost write -g com.apple.trackpad.threeFingerHorizSwipeGesture -int 0
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerHorizSwipeGesture -int 1
# Scroll left or right with two fingers to swipe between pages. (Enable System preferences: TrackPad: More gestures: Swipe between pages: Scroll left or right with two fingers.)
defaults write com.apple.dock showLaunchpadGestureEnabled -int 0 # Disable trackpad Launchpad gesture (pinch with thumb and three fingers).
#echo 'Ink (Inkwell)' # (i) discontinued in macOS 10.15 Catalina.
echo "'Displays' & Display Server (NSGlobalDomain, com.apple.windowserver)"
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool TRUE # Enable Hi-DPI display modes. /!\ requires a restart.
defaults write -g AppleFontSmoothing -int 2 # Enable medium subpixel font rendering on non-Apple LCD displays. (Enable Use LCD Font Smoothing When Available.)
echo "'Printers' (com.apple.print.PrintingPrefs)"
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool TRUE # Automatically quit printer app when printing is over.
#echo "Airplay ('Displays' & Display server)"
echo 'AirPort (Network, or Ethernet & Wi-Fi)'
networksetup -setairportpower en0 on # Enable Wi-Fi.
echo 'Bluetooth & Bluetooth Setup Assistant (com.apple.Bluetooth, com.apple.BluetoothAudioAgent)'
defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekKeyboard '1' # Launch Bluetooth setup assistant at startup if no keyboard is detected.
sudo defaults write /Library/Preferences/com.apple.Bluetooth BluetoothAutoSeekPointingDevice '1' # Launch Bluetooth setup assistant at startup if no mouse or trackpad is detected.
#defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" -int 80
#defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 80
#defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" -int 80
#defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" -int 80
#defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" -int 80
#defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" -int 80
#defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" -int 80
#
if [ "$(defaults read /Library/Preferences/com.apple.Bluetooth ControllerPowerState)" = '0' ] # If Bluetooth is turned off,
then
sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 1 # enable Bluetooth,
#sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist && sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist # Reload the Bluetooth daemon.
#sudo launchctl stop com.apple.blued && sudo launchctl start com.apple.blued # Restart the Bluetooth daemon.
sudo killall -HUP blued # Send SIGTERM to BlueD.
# and restart the Bluetooth daemon.
fi # Turn on Bluetooth.
echo 'Data Storage Devices'
sudo nvram boot-args="mbasd=1" # Enable the MacBook Air SuperDrive on any Mac.
#echo "AppleScript & AppleScript Editor"
echo 'Time Machine'
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool TRUE # Disable local Time Machine prompting to use new drives as backup volumes.
hash tmutil &> /dev/null && sudo tmutil disablelocal # Disable local Time Machine snapshots. (i) deprecated in macOS 10.12 Sierra. # Enter `sudo tmutil enablelocal` to reenable local Time Machine snapshots.
#sudo tmutil setdestination /Volumes/
#sudo tmutil enable
#tmutil startbackup
sudo tmutil enable # Turn on Time Machine.
echo 'UX, Aqua (GUI), SUI & VUI (NSGlobalDomain, com.apple.systempreferences, com.apple.CrashReporter, com.apple.helpviewer, com.apple.systemuiserver)'
defaults write -g NSDocumentSaveNewDocumentsToCloud -bool FALSE # Do not save to iCloud by default.
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool FALSE # Do not reopen windows when logging back in. (Disable resume on restart.) (Disable Reopen windows when logging back in (Resume).)
defaults write -g NSDisableAutomaticTermination -bool TRUE # Disable automatic termination of inactive applications.
#defaults write com.apple.CrashReporter DialogType -string "none" # Disable the crash reporter.
defaults write com.apple.helpviewer DevMode -bool TRUE # Set Help viewer in non-floating mode.
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user # Delete duplicates in Open With menu.
defaults write -g NSWindowResizeTime -float 0.001 # Increase window resizing and fullscreen mode animation speed.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.volume" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Volume.menu"
# Display volume menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.user" -bool FALSE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/User.menu"
# Hide fast user switching menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.universalaccess" -bool FALSE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/UniversalAccess.menu"
# Disable Universal Access menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.bluetooth" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Bluetooth.menu"
# Display Bluetooth (Bluetooth & Bluetooth Setup Assistant) menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.airport" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/AirPort.menu"
# Display AirPort (network, or Wi-Fi) menu bar item.
#defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.ppp" -bool TRUE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/PPP.menu"
# Display PPP menu bar item.
#defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.pppoe" -bool TRUE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/PPPoE.menu"
# Display PPPoE menu bar item.
#defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.vpn" -bool TRUE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/VPN.menu"
# Display VPN menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.TimeMachine" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/TimeMachine.menu"
# Display Time Machine menu bar item.
#defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.scriptmenu" -bool TRUE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Script Menu.menu"
# Display AppleScript Menu (AppleScript & Script Editor) menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.clock" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Clock.menu"
defaults write com.apple.menuextra.clock IsAnalog -bool FALSE
# Display clock menu bar item, and display the clock as digital.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.battery" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Battery.menu"
defaults write com.apple.menuextra.battery ShowPercent -bool TRUE
# Display battery menu bar item, and display the battery percentage.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.textinput" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/TextInput.menu"
# Display text input (Keyboard & Touch Bar) menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.ink" -bool FALSE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Ink.menu"
# Disable Ink (Inkwell) menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.airplay" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Displays.menu"
# Display AirPlay ('Displays' & Display Server) menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.iChat" -bool FALSE
#defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/iChat.menu"
# Disable iChat menu bar item.
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.eject" -bool TRUE
defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Eject.menu"
# Display eject (Menu Bar & Touch Bar (UX, Aqua (GUI), SUI & VUI)) menu bar item.
defaults write -g NSTextShowsControlCharacters -bool TRUE # Display ASCII control characters using caret notation in plain text view.
defaults write -g AppleICUForce12HourTime -bool FALSE # Set 24-hour time format. (Enable System Preferences: Date & Time: Clock: Time Options: Use a 24-hour clock.)
#defaults write -g NSScrollAnimationEnabled -bool FALSE # Disable smooth scrolling. (i) A trick for old Mac that mess up the animation.
defaults write -g AppleShowScrollBars -string "Automatic" # Display scroll bars automatically. # Other values are WhenScrolling and Always.
defaults write com.apple.universalaccess reduceTransparency -bool FALSE # Set translucent menu bar (Enable Translucent Menu Bar.)
#defaults write -g AppleHighlightColor -string "1.000000 0.937255 0.690196" # Set Highlight color to the yellow of OS X 10.10 Yosemite.
sudo nvram SystemAudioVolume=" " # Disable the startup sound. # Enter `sudo nvram -d SystemAudioVolume` to reenable the startup sound.
echo 'Image Capture (com.apple.imagecapture)'
defaults -currentHost write com.apple.ImageCapture2 HotPlugActionPath -string "" # When you connect new cameras, do nothing.
echo 'Finder & AirDrop (NSGlobalDomain, com.apple.desktopservices, com.apple.finder, com.apple.frameworks.diskimages, com.apple.NetworkBrowser)'
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE # Disable .DS_Store file writing on network volumes.
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool TRUE # Enable AirDrop with Ethernet and on unsupported Mac running Mac OS X Lion. (i) introduced in Mac OS X 10.7 Lion.
defaults write com.apple.finder QuitMenuItem -bool TRUE # Enable Quit Finder ⌘Q.
#defaults write com.apple.finder WarnOnEmptyTrash -bool FALSE # Disable the trash emptying warning.
defaults write com.apple.frameworks.diskimages skip-verify -bool TRUE
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool TRUE
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool TRUE
# Disable disk images verification.
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool TRUE
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool TRUE
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool TRUE
# Autoopen a new Finder window when a new volume is mounted.
defaults write com.apple.finder NewWindowTarget -string "PfLo"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
# Set home as new windows directory. # Use "PfDe" and "file://${HOME}/Desktop" for desktop or "PfLo" and "file:///path" for other paths.
defaults write -g com.apple.springing.enabled -bool TRUE # Enable spring loading for directories.
defaults write -g com.apple.springing.delay -float 0 # Set spring loading delay to null.
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" # Set Finder search to search the current folder.
defaults write com.apple.finder FXArrangeGroupViewBy -string Kind # Sort files by kind.
defaults write com.apple.finder ShowStatusBar -bool TRUE # Display status bar.
defaults write com.apple.finder ShowPathbar -bool TRUE # Display path bar.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE # Display full POSIX path as window title.
defaults write com.apple.finder FXInfoPanesExpanded -dict \
General -bool TRUE \
OpenWith -bool TRUE \
Privileges -bool TRUE
# Expand General, Open With and Sharing & Permissions file info panes by default.
defaults write -g NSNavPanelExpandedStateForSaveMode -bool TRUE
defaults write -g PMPrintingExpandedStateForPrint -bool TRUE
defaults write -g PMPrintingExpandedStateForPrint2 -bool TRUE
# Expand the save pane by default.
rm -rf ${HOME}/Library/Application\ Support/Dock/desktoppicture.db && killall Dock
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(15,2,3)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(1,3,3)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(3,4,3)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(4,4,3)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(5,4,3)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(10,1,3)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(10,1,4)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(15,2,4)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(1,3,4)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(3,4,4)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(4,4,4)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(5,4,4)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(10,1,2)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(15,2,2)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(1,3,2)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(3,4,2)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(4,4,2)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(5,4,2)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(10,1,1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(15,2,1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(1,3,1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(3,4,1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(4,4,1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"preferences\" VALUES(5,4,1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"data\" VALUES('/Library/Desktop Pictures/Solid Colors')"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"data\" VALUES(1)"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"data\" VALUES('/System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPane/Contents/Resources/DesktopPictures.prefPane/Contents/Resources/Transparent.tiff')"
sqlite3 ${HOME}/Library/Application\ Support/Dock/desktoppicture.db "INSERT INTO \"data\" VALUES(0.0)"
# Set the wallpaper.
defaults write com.apple.finder FXPreferredViewStyle -string "clmv" # Set the default view to the columns one. (i) Other viewing modes are icnv for icons, Nlsv for newlines and Flwv for Cover flow.
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo TRUE" ${HOME}/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo TRUE" ${HOME}/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo TRUE" ${HOME}/Library/Preferences/com.apple.finder.plist
# Show item info near icons on the desktop and in other icon views.
/usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom FALSE" ${HOME}/Library/Preferences/com.apple.finder.plist # Display desktop items infos to their icons' right.
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool TRUE # Display internal drives on the desktop. (Enable Hard Disks.)
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool TRUE # Display external drives on the desktop. (Enable External Disks.)
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool TRUE # Display removable media (CD, DVD and iPod) on the desktop. (Enable CD, DVD and iPod.)
defaults write com.apple.finder ShowMountedServersOnDesktop -bool TRUE # Display mounted servers on the desktop. (Enable Connected Servers.)
defaults write -g AppleShowAllExtensions -bool TRUE # Show all filename extensions. (Enable Show All Filename Extensions.)
defaults write com.apple.finder AppleShowAllFiles -bool TRUE # Display hidden files.
defaults write com.apple.finder DisableAllAnimations -bool TRUE # Disable Finder window & Get Info pane animations.
echo 'Spotlight (com.apple.Spotlight)'
defaults write com.apple.Spotlight orderedItems -array \
'{"enabled" = 1;"name" = "APPLICATIONS";}' \
'{"enabled" = 0;"name" = "SYSTEM_PREFS";}' \
'{"enabled" = 0;"name" = "DOCUMENTS";}' \
'{"enabled" = 0;"name" = "DIRECTORIES";}' \
'{"enabled" = 0;"name" = "PRESENTATIONS";}' \
'{"enabled" = 0;"name" = "SPREADSHEETS";}' \
'{"enabled" = 0;"name" = "PDF";}' \
'{"enabled" = 0;"name" = "MESSAGES";}' \
'{"enabled" = 1;"name" = "CONTACT";}' \
'{"enabled" = 0;"name" = "EVENT_TODO";}' \
'{"enabled" = 0;"name" = "IMAGES";}' \
'{"enabled" = 0;"name" = "BOOKMARKS";}' \
'{"enabled" = 0;"name" = "MUSIC";}' \
'{"enabled" = 0;"name" = "MOVIES";}' \
'{"enabled" = 0;"name" = "FONTS";}' \
'{"enabled" = 0;"name" = "SOURCE";}' \
# Change indexing order, and set search results.
killall mds > /dev/null 2>&1 # Load new settings before rebuilding the index.
sudo mdutil -i on / > /dev/null # Ensure indexing is enabled for the main volume.
sudo mdutil -E / > /dev/null # Rebuild index from scratch.
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes" # Disable Spotlight indexing for never indexed mounted volumes.
plutil -convert binary1 ${HOME}/.files/Library/Application\ Support/com.apple.spotlight.Shortcuts.plist -o ${HOME}/Library/Application\ Support/com.apple.spotlight.Shortcuts # Set Top Hits.
#sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search # Disable Spotlight menu bar icon.
echo "'Screenshooter' (com.apple.screencapture)"
defaults write com.apple.screencapture type -string 'png' # Set the screenshot format to PNG. # Other options are bmp for Windows Bitmap, gif for GIF, jpg for JPEG, jp2 for JPEG2000, tif for TIFF, pict for Macintosh PICT and tga for TARGA.
defaults write com.apple.screencapture name -string 'Screenshot' # Set screenshot filename to 'Screenshot ${YYYY}-${MM}-${DD} at ${h}.${mn}.${s}.${ext}'. # default option: 'Screen Shot'; custom options: '', and '\b' lead to a whitespace at the beginning of the filename that the latter cannot erase.
#defaults write com.apple.screencapture include-date -bool FALSE # Disable date in screenshot filename.
#defaults write com.apple.screencapture location -string "${HOME}/Desktop" # Set screenshot writing location to Desktop/.
#defaults write com.apple.screencapture disable-shadow -bool TRUE # Disable shadows in screenshots.
echo 'QuickLook (com.apple.finder)'
#echo -n "0x08000100:0x0" > ${HOME}/.CFUserTextEncoding # Fix the UTF-8 bug of QuickLook. /!\ causes issues with Adobe Illustrator CS5.
defaults write com.apple.finder QLEnableTextSelection -bool TRUE # Enable text selection in QuickLook.
echo 'Dock (com.apple.dock)'
#defaults write com.apple.dock single-app -bool FALSE # Disable Single app mode.
defaults write com.apple.dock minimize-to-application -bool TRUE # Enable window's title bar double-clicking to minimize.
defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool TRUE # Enable spring loading for all items.
defaults write com.apple.dock scroll-to-open -bool TRUE # Enable scroll gestures.
defaults write com.apple.dock mouse-over-hilite-stack -bool TRUE # Enable highlight when hovering for the grid view of a stack.
defaults write com.apple.dock show-process-indicators -bool TRUE # Display indicator lights for open applications.
defaults write com.apple.dock showhidden -bool TRUE # Enable translucent items for hidden apps.
defaults write com.apple.dock pinning -string start # Set position to the left or top.
defaults write com.apple.dock orientation left # Set alignment to the left or top.
defaults write com.apple.dock persistent-apps -array
defaults write com.apple.dock persistent-others -array
# Delete Dock items.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Firefox.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Firefox app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/iTerm.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create an iTerm2 app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/VMware Fusion.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a WMware Fusion app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Server.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Server app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/iTunes.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create an iTunes app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Utilities/Activity Monitor.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create an Activity Monitor app item.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create a spacer item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Stickies.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Stickies app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/TextEdit.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a TextEdit app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/LibreOffice.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a LibreOffice app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/GIMP-2.10.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a GIMP app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Sketch.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Sketch app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Inkscape.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create an Inscape app item.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create a spacer item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Preview.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Preview app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/VLC.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a VLC Media Player app item.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create a spacer item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Calendar.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Calendar app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Contacts.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Contacts app item.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create a spacer item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/ProtonMail Bridge.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a ProtonMail Bridge app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Mail.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Mail app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Signal.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Signal app item.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create a spacer item.
#defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Utilities/AppleScript Editor.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create an AppleScript Editor app item. (i) AppleScript Editor is named Script Editor from OS X Yosemite onwards.
#defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Xcode.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Xcode app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Jumpcut.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Jumpcut app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/SizeUp.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a SizeUp app item.
defaults write com.apple.dock persistent-apps -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>/Applications/Dropbox.app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' # Create a Dropbox app item.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create a spacer item.
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' # Create a recent items stack others item.
defaults write com.apple.dock persistent-others -array-add '<dict><key>tile-data</key><dict><key>arrangement</key><integer>1</integer><key>displayas</key><integer>1</integer><key>file-data</key><dict><key>_CFURLString</key><string>file:///Applications/</string><key>_CFURLStringType</key><integer>15</integer></dict><key>file-label</key><string>Applications</string><key>file-type</key><integer>2</integer><key>preferreditemsize</key><integer>-1</integer><key>showas</key><integer>2</integer></dict><key>tile-type</key><string>directory-tile</string></dict>' # Create an Applications others item.
defaults write com.apple.dock persistent-others -array-add '<dict><key>tile-data</key><dict><key>arrangement</key><integer>2</integer><key>displayas</key><integer>1</integer><key>file-data</key><dict><key>_CFURLString</key><string>file:///Users/kvpb/Downloads/</string><key>_CFURLStringType</key><integer>15</integer></dict><key>file-label</key><string>Downloads</string><key>file-type</key><integer>2</integer><key>preferreditemsize</key><integer>-1</integer><key>showas</key><integer>2</integer></dict><key>tile-type</key><string>directory-tile</string></dict>' # Create a Downloads others item.
defaults write com.apple.dock persistent-others -array-add '<dict><key>tile-data</key><dict><key>arrangement</key><integer>5</integer><key>displayas</key><integer>1</integer><key>file-data</key><dict><key>_CFURLString</key><string>file:///Users/kvpb/Dropbox/</string><key>_CFURLStringType</key><integer>15</integer></dict><key>file-label</key><string>Dropbox</string><key>file-type</key><integer>2</integer><key>preferreditemsize</key><integer>-1</integer><key>showas</key><integer>2</integer></dict><key>tile-type</key><string>directory-tile</string></dict>' # Create a Dropbox others item.
defaults delete com.apple.dock mod-count
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create an app item area spacer item.
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}' # Create an other items area spacer item.
defaults write com.apple.dock mineffect -string "scale" # Set window minimaximazation effect to scale. # Do not set to hidden 'suck' which, y'know, sucks.
defaults write com.apple.dock hide-mirror -bool TRUE # Disable mirror effect.
defaults write com.apple.dock no-glass -bool YES # Disable glass effect.
defaults write com.apple.dock launchanim -bool FALSE # Disable opening applications animation.
defaults write com.apple.dock autohide -bool TRUE # Enable autohiding.
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
# Speed autohiding animation up.
echo 'Mission Control (com.apple.dock)' # (i) has been substituted for Exposé.
defaults write com.apple.dock mru-spaces -bool FALSE # Disable automatic spaces rearranging based on most recent use.
#defaults write com.apple.dock expose-group-by-app -bool FALSE # Do not group windows by application. (Set the behavior of Mission Control behavior to that of Exposé.) (Disable Group Windows By Application.)
defaults write com.apple.dock expose-animation-duration -float 0.1 # Speed animations up.
echo 'Dashboard (com.apple.dock, com.apple.dashboard)'
defaults write com.apple.dock dashboard-in-overlay -bool TRUE # Hide dashboard as a space.
defaults write com.apple.dashboard mcx-disabled -bool TRUE # Disable the dashboard.
#defaults write com.apple.dashboard devmode -bool TRUE # Enable dashboard dev mode. (i) allows to keep widgets on the desktop.
echo 'Launchpad (com.apple.dock)'
defaults write com.apple.dock ResetLaunchPad -bool TRUE # Reset Launchpad organization to defaults.
sudo ln -sf "/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app" "/Applications/iOS Simulator.app" # Add iOS simulator to Launchpad.
defaults write com.apple.dock showLaunchpadGestureEnabled -int 0 # Disable the pinch-with-thumb-and-three-fingers trackpad gesture. (Launchpad: Trackpad -> System preferences: TrackPad: More gestures.)
#echo 'Notification Center'
#
#launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null # Disable the notification center, and remove its menu bar item. (i) 'fixed' by Apple on macOS 10.13 High Sierra. # But hey, 'It's not a bug; it's a feature'.
echo 'Software Update & App Store (com.apple.SoftwareUpdate, com.apple.commerce, com.apple.appstore)'
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool TRUE # Enable the automatic update check.
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 # Set software updates check frequency to daily.
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 0 # Disable available updates background automatic download.
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 0 # Disable system data files and security updates automatic installation.
defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 0 # Disable automatic download of apps purchased on other Apple computers.
defaults write com.apple.commerce AutoUpdate -bool FALSE # Disable app autoupdate.
defaults write com.apple.commerce AutoUpdateRestartRequired -bool TRUE # Block the App store to reboot the machine on OS X updates.
defaults write com.apple.appstore ShowDebugMenu -bool TRUE # Enable the App store's debug menu.
defaults write com.apple.appstore WebKitDeveloperExtras -bool TRUE # Enable the App store's WebKit dev tools.
#echo 'Xcode'
#xcode-select --install
#xcodebuild -license accept
# Install Xcode and accept the Xcode EULA.
echo 'Terminal & X11 (com.apple.terminal, org.x.X11, com.apple.x11)'
defaults write com.apple.terminal StringEncodings -array 4 # Set Terminal encoding to UTF-8.
defaults write com.apple.terminal ApplePressAndHoldEnabled -bool FALSE # Disable Terminal press-and-hold for keys.
defaults write com.apple.terminal SecureKeyboardEntry -bool TRUE # Enable Terminal secure keyboard entry.
defaults write com.apple.terminal FocusFollowsMouse -bool TRUE
defaults write com.apple.x11 wm_ffm -bool TRUE # Enter `defaults write org.x.X11 wm_ffm -bool TRUE` for Mac OS X Snow Leopard.
# Enable focus follows mouse (point-to-focus) for Terminal and X11 apps.
defaults write com.apple.terminal StartAtLogin -bool TRUE # Launch Terminal at startup.
echo 'TextEdit (com.apple.TextEdit, com.apple.LaunchServices)'
#defaults write com.apple.TextEdit NSUserKeyEquivalents \
#'{\
# "\033Edit\033Transformations\033Capitalize" = "@~$u";\
# "\033Edit\033Transformations\033Make Lower Case" = "@$l";\
# "\033Edit\033Transformations\033Make Upper Case" = "@$u";\
# "\033Format\033Font\033Baseline\033Subscript" = "@~$-";\
# "\033Format\033Font\033Baseline\033Superscript" = "@$6";\
# Justify = "@~$[";\
#}';
# Add TextEdit keyboard app shortcuts:
# - Alt-Shift-U 'Capitalize'
# - Shift-L 'Make Lower Case'
# - Shift-U 'Make Upper Case'
# - Shift-Command-6 (Command-^ on US Mac keyboard layout) 'Superscript'
# - Shift-Command-- (Command-_ on US Mac keyboard layout) 'Subscript'
# - Alt-Shift-Command-[ (Option-Command-{ on US Mac keyboard layout) 'Justify'
defaults write com.apple.TextEdit ShowRuler -bool FALSE # Show ruler.
defaults write com.apple.TextEdit SmartCopyPaste -bool FALSE # Disable smart copypaste.
defaults write com.apple.TextEdit SmartQuotes -bool FALSE # Disable smart quotes.
defaults write com.apple.TextEdit SmartDashes -bool FALSE # Disable smart dashes.
defaults write com.apple.TextEdit SmartLinks -bool FALSE # Disable smart links.
defaults write com.apple.TextEdit TextReplacement -bool FALSE # Disable text replacement.
defaults write com.apple.TextEdit CorrectSpellingAutomatically -bool FALSE # Disable Correct spelling automatically.
defaults write com.apple.TextEdit CheckSpellingWhileTyping -bool FALSE # Do not check spelling as you type.
defaults write com.apple.TextEdit CheckGrammarWithSpelling -bool FALSE # Do not check grammar with spelling.
defaults write com.apple.TextEdit DataDetectors -bool FALSE # Disable data detectors.
defaults write com.apple.TextEdit PlainTextEncoding -int 4 # Set UTF-8 as plain text file opening encoding. (Set TextEdit: Preferences: Open and save: Plain text encoding: Opening files to Unicode (UTF-8).)
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4 # Set UTF-8 as plain text file saving encoding. (Set TextEdit: Preferences: Open and save: Plain text encoding: Saving files to Unicode (UTF-8).)
defaults write com.apple.TextEdit NSFixedPitchFont -string "Menlo-Regular"
defaults write com.apple.TextEdit NSFixedPitchFontSize -int "10"
# Set Apple Menlo 10pt as plain text font. (i) Apple Menlo 10pt is the default fixed-width font of OS X.
defaults write com.apple.TextEdit NSFont -string "TimesNewRomanPSMT"
defaults write com.apple.TextEdit NSFontSize -int "12"
# Set rich text font to Monotype Times New Roman 12pt.
defaults write com.apple.TextEdit RichText -int 0 # Set plain text as new document text format.
defaults write com.apple.TextEdit ShowPageBreaks -bool TRUE # Do not wrap to page.
defaults write com.apple.TextEdit WidthInChars -int 80 # Set new document window width to 80 characters (or columns).
defaults write com.apple.TextEdit HeightInChars -int 24 # Set new document window height to 24 characters (or lines).
defaults write com.apple.TextEdit TabWidth -int 4 # Set tab width to 4 chars.
defaults write com.apple.TextEdit AddExtensionToNewPlainTextFiles -bool FALSE # Do not add .txt extension plain text files at save. (Disable Add '.txt' extension to plain text files.)
defaults write com.apple.TextEdit author -string "Karl V. P. Bertin" # Set new document author name to KVPB's.
defaults write com.apple.TextEdit company -string "" # Set new document company name.
defaults write com.apple.TextEdit copyright -string "" # Set new document copyright.
defaults write com.apple.TextEdit IgnoreHTML -bool TRUE # Display HTML files as code. (Enable Display HTML files as HTML code instead of formatted text.)
defaults write com.apple.TextEdit IgnoreRichText -bool FALSE # Display RTF files as formatted text. (Disable Display RTF files as RTF code instead of formatted text.)
defaults write com.apple.TextEdit HTMLEncoding -int 20 # Set UTF-8 as HTML file encoding. (Set TextEdit: Preferences: Open And Save: HTML Saving Options: Encoding to Unicode (UTF-8).)
defaults write com.apple.TextEdit UseXHTMLDocType -bool FALSE
defaults write com.apple.TextEdit UseTransitionalDocType -bool TRUE
# Set new HTML document type to HTML 4.01 transitional. # Both are crossed attributes, e.g. enter `UseXHTMLDocType -bool FALSE` and `UseTransitionalDocType -bool FALSE` to set document type to HTML 4.01 strict.
defaults write com.apple.TextEdit UseEmbeddedCSS -bool FALSE
defaults write com.apple.TextEdit UseInlineCSS -bool FALSE
# Set new HTML document styling to embedded CSS. # Both are crossed attributes, e.g. enter `UseEmbeddedCSS -bool FALSE` and `UseInlineCSS -bool FALSE` to set styling to no CSS.
defaults write com.apple.TextEdit PreserveWhitespace -bool TRUE # Preserve white space.
#defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=org.openxmlformats.wordprocessingml.document;LSHandlerRoleAll=com.apple.textedit;}'
# Set TextEdit as default Office Open XML Document editor.
echo 'Disk Utility (com.apple.DiskUtility)'
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool TRUE
defaults write com.apple.DiskUtility advanced-image-options -bool TRUE
# Enable the debug menu.
echo 'Activity Monitor (com.apple.ActivityMonitor)'
defaults write com.apple.ActivityMonitor OpenMainWindow -bool TRUE # Display the main window when launching.
defaults write com.apple.ActivityMonitor ShowCategory -int 0 # Display all processes.
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
# Display results sorted by CPU usage.
defaults write com.apple.ActivityMonitor IconType -int 5 # Display CPU usage icon in the Dock.
echo 'Safari & WebKit (com.apple.Safari)' # This section has been the first example of how I want such scripts to configure OS: in case of emergency on a clean install, what is needed the most is set first.
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool TRUE
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool TRUE
# Bind Tab to highlight webpage items. (Enable Press Tab to highlight each item on a webpage.)
defaults write com.apple.Safari CommandClickMakesTabs -int 1 # Bind command-right click to open links in new tabs. (Enable ⌘-click opens a link in a new tab.)
defaults write com.apple.Safari WebKitDefaultTextEncodingName -string "utf-8" # Set UTF-8 as default encoding. (Set Default Encoding to Unicode (UTF-8).)
defaults write com.apple.Safari HistoryAgeInDaysLimit -int 2147483647 # Remove history items after Int32. ('Disable' history automatic removal.) (Set Remove History Items to After Int32.)
defaults write com.apple.Safari LocalFileRestrictionsEnabled -bool TRUE # Disable local files access. (Disable Disable Local File Restrictions.)
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool TRUE # Warn when visiting a fraudulent website.
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool TRUE
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool TRUE
# Enable the web inspector.
defaults write com.apple.Safari WebKitMinimumFontSize -int 0
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2MinimumFontSize -int 0
# Never use font sizes smaller than 9. (Enable Never use font sizes smaller than N.) (Set Never use font sizes smaller than to 9.)
defaults write com.apple.Safari UserStyleSheetEnabled -int 0 # Set Style sheet to None selected.
defaults write com.apple.Safari DownloadsPath -string "${HOME}/Downloads" # Set ${HOME}/Downloads/ as downloads storage path. (Set Save Downloaded Files to To Downloads/.)
defaults write com.apple.Safari AutoOpenSafeDownloads -bool FALSE # Do not open 'safe' files after downloading. (Disable Open “Safe” Files After Downloading.)
defaults write com.apple.Safari HomePage -string "https://www.perdu.com" # Set homepage URL to about:blank.
defaults write com.apple.Safari NewWindowBehavior -int 0 # New windows open with homepage. (Set New windows open with to Homepage.)
defaults write com.apple.Safari NewTabBehavior -int 0 # New tabs open with homepage. (Set New tabs open with to Homepage.)
defaults write com.apple.Safari AlwaysRestoreSessionAtLaunch -bool TRUE # Safari opens with all windows from last session. (Enable Safari sessions restoration at launch.) (Set Safari opens with to All windows from last session.)
defaults write com.apple.Safari OpenNewTabsInFront -bool FALSE # Do not make a new tab or window active when it opens. (Disable new tabs automatic activation.) # 'Activation' is when a window is brought to foreground.
defaults write com.apple.Safari TabCreationPolicy -int 1 # Automatically open pages in tabs instead of windows. (Set pages to automatically open in tabs instead of windows.) (Set Open pages in tabs instead of windows to Automatically.)
defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool FALSE
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool FALSE
# Block popup windows.
defaults write com.apple.Safari WebKitStorageBlockingPolicy -int 1
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2StorageBlockingPolicy -int 1
# Block cookies and other website data from third parties and advertisers. (Set Block cookies and other website data to From third parties and advertisers.)
defaults write com.apple.Safari SafariGeolocationPermissionPolicy -int 0 # Deny without prompting website use of location services. ('Disable' location services access.) (Set Limit website access to location services to Deny without prompting.)
defaults write com.apple.Safari SuppressSearchSuggestions -bool TRUE # Prevent search engine from providing suggestions. (Block search engines suggestions providing.) (Enable Prevent search engine from providing suggestions.)
defaults write com.apple.Safari PreloadTopHit -bool FALSE # Do not preload Top hit in the background. (Disable top hit preloading.) (Enable Do not preload Top hit in the background.)
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool TRUE # Ask websites not to track me. (Enable Do not track.) (Enable Ask websites not to track me.)
defaults write com.apple.Safari CanPromptForPushNotifications -bool FALSE # Do not allow websites to ask for permission to send push notifications. ('Disable' push notifications for websites.) (Disable Allow websites to ask for permission to send push notifications.)
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PlugInSnapshottingEnabled -bool FALSE # Stop plug-ins to save power. (Enable Stop plugins to save power.)
defaults write com.apple.Safari WebKitPluginsEnabled -bool FALSE
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool FALSE
# Disable plugins.
defaults write com.apple.Safari WebKitJavaEnabled -bool FALSE
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool FALSE
# Disable Java.
defaults write com.apple.Safari WebKitJavaScriptEnabled -bool TRUE
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptEnabled -bool TRUE
# Enable JavaScript.
defaults write com.apple.Safari ExtensionsEnabled -bool FALSE # Enable Safari extensions. (Enable Extensions.)
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool TRUE # Install updates automatically. (Enable automatic extensions updates.) (Enable Install updates automatically.)
defaults write com.apple.Safari AutoFillPasswords -bool FALSE # Do not AutoFill using names and passwords. (Disable AutoFill user names and passwords.)
defaults write com.apple.Safari AutoFillCreditCardData -bool FALSE # Do not AutoFill credit cards. (Disable Credit cards.)
defaults write com.apple.Safari AutoFillFromAddressBook -bool FALSE # Do not AutoFill using info from my Contacts card. (Disable Using info from my Contacts card.)
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool FALSE # Do not AutoFill other forms. (Disable Other forms.)
# Do not AutoFill web forms. (Disable AutoFill.)
defaults write com.apple.Safari DefaultPageZoom -float 1.000000 # Set the default page zoom level to 100%.
defaults write com.apple.Safari IncludeDevelopMenu -bool TRUE # Show Develop menu in menu bar. (Display develop menu in the menu bar.) (Enable Show Develop menu in menu bar.)
defaults write com.apple.Safari ShowStatusBar -bool TRUE # Show status bar ⌘/. (Display the status bar.) (Enable Show status bar ⌘/.)
defaults write com.apple.Safari BookmarksMenuIncludesRendezvous -bool FALSE # Disable bookmarks Bonjour menu.
defaults write com.apple.Safari ProxiesInBookmarksBar "()" # Clear favorite bookmarks bar. (Remove Reading list and Top sites from the bookmarks bar.)
defaults write com.apple.Safari ShowFavoritesBar -bool FALSE # Hide favorite bookmarks bar. (Hide Favorites bar ⇧⌘B.)
defaults write com.apple.Safari SidebarViewModeIdentifier -string "Bookmarks" # Display bookmarks sidebar.
defaults write com.apple.Safari ShowSidebarInNewWindows -bool FALSE # Hide sidebar in new windows.
defaults write com.apple.Safari TopSitesGridArrangement -int 0 # Top Sites shows 6 sites. (Display as few top sites as possible.) (Set Top sites shows to 6 sites.)
echo 'Mail (com.apple.mail)'
defaults write com.apple.mail DisableInlineAttachmentViewing -bool TRUE # Disable inline attachments. (Only show the icons.)
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool FALSE # Copy email addresses as ${firstname}.${lastname}@${domain}.${sx} instead of '${Firstname} ${Lastname} <${firstname}.${lastname}@${domain}.${sx}>'. (i) Disable Use smart addresses.
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "YES"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedAscending" -string "YES"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
# Show most recent message at the top. (Display emails in threaded mode, and sort them as newest at the top.) (Enable Show most recent message at the top.)
defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled" # Never check spelling. (Set Check Spelling to Never.) (Disable automatic spell checking.)
echo 'Calendar (com.apple.iCal)' # (i) was formerly iCal.
defaults write com.apple.iCal "scroll by weeks in week view" -int 2 # Scroll in week view by week, stop on today. (Set Scroll in week view by to Week, stop on today.)
defaults write com.apple.iCal "first day of week" -int 1 # Set week start to monday.
defaults write com.apple.iCal "Show Week Numbers" -bool TRUE # Display week numbers. (i) introduced in OS X 10.8 Mountain Lion.
defaults write com.apple.iCal "Show time in Month View" -bool TRUE # Display events time in month view.
defaults write com.apple.iCal "n days of week" -int 7 # Display 7 days.
#echo 'Contacts (com.apple.addressbook)' # (i) formerly named Address Book.
#echo 'iChat'
echo 'Messages (com.apple.messageshelper.MessageController)'
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool FALSE # Disable automatic emoji substitution.
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool FALSE # Disable smart quotes.