forked from CoreyMSchafer/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrew.sh
More file actions
181 lines (152 loc) · 4.77 KB
/
Copy pathbrew.sh
File metadata and controls
181 lines (152 loc) · 4.77 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
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
#!/usr/bin/env zsh
# Install Homebrew if it isn't already installed
if ! command -v brew &>/dev/null; then
echo "Homebrew not installed. Installing Homebrew."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Attempt to set up Homebrew PATH automatically for this session
if [ -x "/opt/homebrew/bin/brew" ]; then
# For Apple Silicon Macs
echo "Configuring Homebrew in PATH for Apple Silicon Mac..."
export PATH="/opt/homebrew/bin:$PATH"
fi
else
echo "Homebrew is already installed."
fi
# Verify brew is now accessible
if ! command -v brew &>/dev/null; then
echo "Failed to configure Homebrew in PATH. Please add Homebrew to your PATH manually."
exit 1
fi
# Update Homebrew and Upgrade any already-installed formulae
brew update
brew upgrade
brew upgrade --cask
brew cleanup
# Define an array of packages to install using Homebrew.
packages=(
"bat"
"python"
"git"
"tree"
"bash"
"zsh"
"pylint"
"black"
"node"
"wireguard-go"
"gh"
"vim"
"powerlevel10k"
)
# Loop over the array to install each application.
for package in "${packages[@]}"; do
if brew list --formula | grep -q "^${package}\$"; then
echo "${package} is already installed. Skipping..."
else
echo "Installing ${package}..."
brew install "${package}"
fi
done
# Add the Homebrew zsh to allowed shells
echo "Changing default shell to Homebrew zsh"
echo "$(brew --prefix)/bin/zsh" | sudo tee -a /etc/shells >/dev/null
# Set the Homebrew zsh as default shell
chsh -s "$(brew --prefix)/bin/zsh"
# Source zshrc to configure powerlevel10k
source ~/.zshrc
# Install github copilot shell extension
# This requires you to sign in through Gitlab website
gh auth login
gh extension install github/gh-copilot
# Git config name
echo "Please enter your FULL NAME for Git configuration:"
read git_user_name
# Git config email
echo "Please enter your EMAIL for Git configuration:"
read git_user_email
# Set my git credentials
$(brew --prefix)/bin/git config --global user.name "$git_user_name"
$(brew --prefix)/bin/git config --global user.email "$git_user_email"
echo "Copy config from ${HOME}/dotfiles/settings/gitconfig to ~/.gitconfig"
echo "Press enter to continue..."
read
# Install Prettier, which I use in both VS Code and Sublime Text
$(brew --prefix)/bin/npm install --global prettier
# Define an array of applications to install using Homebrew Cask.
apps=(
"1password"
"google-chrome"
"google-drive"
"thonny"
"tor-browser"
"visual-studio-code"
"gimp"
"vlc"
"docker"
"iterm2"
"dropbox"
"beekeeper-studio"
)
# Loop over the array to install each application.
for app in "${apps[@]}"; do
if brew list --cask | grep -q "^$app\$"; then
echo "$app is already installed. Skipping..."
else
echo "Installing $app..."
brew install --cask "$app"
fi
done
# Tool to create dynamic wallpapers
# https://github.com/mczachurski/wallpapper
# brew tap mczachurski/wallpapper
# brew install wallpapper
# Set dynamic wallpapers (light/dark)
# echo "Open ${HOME}/dotfiles/settings/wallpaper.json and update the path to the wallpaper images."
# read
# IMAGE_PATH="${HOME}/dotfiles/settings/Desktop.heic"
# wallpapper -i "${HOME}/dotfiles/settings/wallpaper.json" \
# -o "${IMAGE_PATH}"
# AppleScript command to set the desktop background
#echo "Setting desktop background..."
#osascript <<EOF
#tell application "System Events"
# set desktopCount to count of desktops
# repeat with desktopNumber from 1 to desktopCount
# tell desktop desktopNumber
# set picture to "${IMAGE_PATH}"
# end tell
# end repeat
#end tell
#EOF
# Install Source Code Pro Font
# Tap the Homebrew font cask repository if not already tapped
brew tap | grep -q "^homebrew/cask-fonts$" || brew tap homebrew/cask-fonts
# Define the font name
font_name="font-source-code-pro"
# Check if the font is already installed
if brew list --cask | grep -q "^$font_name\$"; then
echo "$font_name is already installed. Skipping..."
else
echo "Installing $font_name..."
brew install --cask "$font_name"
fi
# Once font is installed, Import your Terminal Profile
echo "Import your terminal settings..."
echo "iTerm2 -> Settings -> Profiles -> Import..."
echo "Import from ${HOME}/dotfiles/settings/iterm2-profile.json"
echo "Make default setting"
echo "Press enter to continue..."
read
# Update and clean up again for safe measure
brew update
brew upgrade
brew upgrade --cask
brew cleanup
echo "Sign in to 1Password. Press enter to continue..."
read
echo "Sign in to Google Chrome. Press enter to continue..."
read
echo "Sign in to Google Drive. Press enter to continue..."
read
echo "Sign in to Dropbox. Press enter to continue..."
read