-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitial_setup.sh
More file actions
executable file
·109 lines (87 loc) · 3.9 KB
/
initial_setup.sh
File metadata and controls
executable file
·109 lines (87 loc) · 3.9 KB
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
#!/usr/bin/env bash
set -o errexit
declare -a DOCK_APPS
declare -a FOLDERS
DOCK_APPS=()
FOLDERS=(
~/.config/git
~/.config/direnv
~/.config/zsh
~/.config/plugins/zsh
~/.config/yamllint
~/.config/aerospace
~/.config/starship
~/.config/tmux
~/.config/ghostty
~/.config/1Password/ssh
~/.cache/zsh
~/.ssh
~/.kube
~/bin
~/personal/kubeconfigs
~/containeroo
~/tmp
~/.jsonnet/lib
)
# Install Rosetta 2
sudo softwareupdate --install-rosetta
# Create folders
for folder in "${FOLDERS[@]}"; do
mkdir -p "$folder"
done
# Install Homebrew
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
export PATH="/opt/homebrew/bin:$PATH"
brew bundle install # Install all packages
touch ~/.hushlogin # Disable login message
defaults write "Apple Global Domain" AppleReduceDesktopTinting -int 1 # Disable window tinting
defaults write com.apple.dock autohide -int 1 # Automatically hide Dock
defaults write com.apple.dock tilesize -int 50 # Set Dock size
defaults write com.apple.dock magnification -int 1 # Enable magnification
defaults write com.apple.dock largesize -int 80 # Set magnification size
defaults write com.apple.dock show-recents -int 0 # Do not display recent apps
# Configure Dock apps
defaults write com.apple.dock persistent-apps -array
for app in "${DOCK_APPS[@]}"; do
defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>$app</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
done
killall Dock
defaults write com.apple.finder _FXSortFoldersFirst -int 1 # Keep folders on top
defaults write com.apple.finder NewWindowTarget -string "PfHo" # New Finder windows open home directory
defaults write -g ApplePressAndHoldEnabled -bool false # Enable key repeat
defaults write NSGlobalDomain _HIHideMenuBar -bool true # Hide menu bar
# Install zsh plugins
git clone https://github.com/catppuccin/zsh-syntax-highlighting.git ~/.config/plugins/zsh/catppuccin-zsh-syntax-highlighting
git clone https://github.com/ahmetb/kubectl-aliases.git ~/.config/plugins/zsh/kubectl-aliases
git clone https://github.com/Aloxaf/fzf-tab ~/.config/plugins/zsh/fzf-tab
# Install kubectl plugins
kubectl krew update
kubectl krew install cnpg
kubectl krew install neat
kubectl krew install node-shell
kubectl krew install resource-capacity
kubectl krew install tree
# Disable animations when opening and closing windows.
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Accelerated playback when adjusting the window size.
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
repo_path=$(pwd)
# Create symlinks
ln -sf "${repo_path}/zprofile" ~/.zprofile
ln -sf "${repo_path}/personal/ssh/config" ~/.ssh/config
ln -sf "${repo_path}/config/zsh/aliasrc" ~/.config/zsh/aliasrc
ln -sf "${repo_path}/config/starship/starship.toml" ~/.config/starship/starship.toml
ln -sf "${repo_path}/config/git/config" ~/.config/git/config
ln -sf "${repo_path}/personal/config/git/personal.conf" ~/.config/git/personal.conf
ln -sf "${repo_path}/config/direnv/direnv.toml" ~/.config/direnv/direnv.toml
ln -sf "${repo_path}/config/aerospace/aerospace.toml" ~/.config/aerospace/aerospace.toml
ln -sf "${repo_path}/config/nvim" ~/.config/nvim
ln -sf "${repo_path}/config/tmux/tmux.conf" ~/.config/tmux/tmux.conf
ln -sf "${repo_path}/config/zsh/zshrc" ~/.config/zsh/.zshrc
ln -sf "${repo_path}/config/yamllint/config" ~/.config/yamllint/config
ln -sf "${repo_path}/config/ghostty/config" ~/.config/ghostty/config
ln -sf "${repo_path}/bin/ansible-vault-pass" ~/bin/ansible-vault-pass
ln -sf "${repo_path}/bin/tmux-sessionizer" ~/bin/tmux-sessionizer
ln -sf "${repo_path}/bin/tmux-sshionizer" ~/bin/tmux-sshionizer
ln -sf "${repo_path}/personal/config/1Password/ssh/agent.toml" ~/.config/1Password/ssh/agent.toml
echo "Done! Please restart your computer."