-
Notifications
You must be signed in to change notification settings - Fork 1
/
.macos
76 lines (54 loc) · 3.84 KB
/
.macos
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
#!/usr/bin/env bash
# Close any open System Preferences panes
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
sudo scutil --set ComputerName "Ghost"
sudo scutil --set HostName "Ghost"
sudo scutil --set LocalHostName "Ghost"
###############################################################################
# Software Update #
###############################################################################
# System Preferences > Software Update > Advanced > Automatically: Check for updates
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
# System Preferences > Software Update > Advanced > Automatically: Download new updates when available
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true
# System Preferences > Software Update > Advanced > Automatically: Install macOS updates
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -bool true
# System Preferences > Software Update > Advanced > Automatically: Install app updates from the App Store
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutoUpdate -bool true
# System Preferences > Software Update > Advanced > Automatically: Install system data files and security updates
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true
###############################################################################
# Dock & Menu Bar #
###############################################################################
# System Preferences > Dock & Menu Bar > Automatically hide and show the Dock
defaults write com.apple.dock autohide -bool true
###############################################################################
# Mission Control #
###############################################################################
# System Preference > Mission Control > Automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
###############################################################################
# Finder #
###############################################################################
# Desktop > Show View Options > Stack By: Kind
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:GroupBy Kind" ~/Library/Preferences/com.apple.finder.plist
# Desktop > Show View Options > Sort By: Name
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy name" ~/Library/Preferences/com.apple.finder.plist
# Finder > Show View Options > Sort By: Name
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy name" ~/Library/Preferences/com.apple.finder.plist
###############################################################################
# Kill affected applications #
###############################################################################
for app in "Dock" "Finder"; do
echo "Killing ${app}"
killall "${app}" &> /dev/null
done
echo "Done. Note that some of these changes require a logout/restart to take effect."