forked from mfunyu/config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
42mac_setup.sh
executable file
·77 lines (60 loc) · 2.25 KB
/
42mac_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/zsh -e
#-------------------MenuBar----------------------#
echo "Setting up Menu bar ..."
## display textinput icon
defaults write com.apple.systemuiserver \
"NSStatusItem Visible com.apple.menuextra.textinput" 1
defaults write com.apple.systemuiserver \
menuExtras -array-add "/System/Library/CoreServices/Menu Extras/TextInput.menu"
## display volume icon
defaults write com.apple.systemuiserver \
"NSStatusItem Visible com.apple.menuextra.volume" 1
defaults write com.apple.systemuiserver \
menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Volume.menu"
## display bluetooth icon
defaults write com.apple.systemuiserver \
"NSStatusItem Visible com.apple.menuextra.bluetooth" 1
defaults write com.apple.systemuiserver \
menuExtras -array-add "/System/Library/CoreServices/Menu Extras/Bluetooth.menu"
# reload MenuBar
killall SystemUIServer
#-------------------Dock----------------------#
echo "Setting up Dock ..."
defaults write com.apple.dock orientation left
defaults write com.apple.dock magnification -bool true
defaults write com.apple.dock largesize -int 96
defaults write com.apple.dock autohide -bool true
## delete all icons
defaults write com.apple.dock persistent-apps -array
# for recovery
# defaults delete com.apple.dock
# reload Dock
killall Dock
#-------------------Others----------------------#
echo "Setting up the rest ..."
## screen shot prefix
defaults write com.apple.screencapture name "SS"
# reload
killall SystemUIServer
## ban .DS_store
defaults write com.apple.desktopservices DSDontWriteNetworkStores True
# reload
killall Finder
#-------------------Install brew------------------#
echo "Setting up Dock ..."
# install brew
if [ ! -e $HOME/goinfre/.brew ]; then
curl -fsSL https://raw.githubusercontent.com/mfunyu/config/main/42homebrew_install.sh | zsh
fi
# apply brew cmd
source ~/.zshrc
#-------------------Custom Dock------------------#
brew install dockutil
dockutil --add /Applications/System\ Preferences.app
dockutil --add /Applications/Launchpad.app
dockutil --add /Applications/Google\ Chrome.app
dockutil --add /Applications/iTerm.app
dockutil --add /Applications/Visual\ Studio\ Code.app
dockutil --add /Applications/Discord.app
dockutil --add /Applications/Slack.app
dockutil --add /Applications/Calendar.app