-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·58 lines (48 loc) · 1.89 KB
/
install.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
#!/bin/zsh
#
# the reason for this script to be bash and not fish is that bash or zsh is available by default on macos
function heading() {
echo -e "\e[1m\e[34m==>\e[39m $@\e[0m"
}
function warning() {
echo -e "\e[1m\e[33mWarning:\e[39m $@\e[0m"
}
SELF_PATH="$( cd "$( dirname "$0" )" && pwd )" # Path to the directory containing this script
heading "[brew] installing/updating homebrew..."
# instaling brew
brew --version || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# intsalling packages from brew
heading "[brew] installing/updating packages..."
brew bundle --file ~/.dotfiles/Brewfile
# create symlinks
heading "[symlinks] installing symbol links..."
for file in `find $SELF_PATH -maxdepth 1 -name \*.symlink`; do
src_file=`basename "$file"`
dest_file=`echo "$HOME/.$src_file" | sed "s/\.symlink$//g"`
if [ -e $dest_file ]; then
warning "$dest_file already exists; skipping it..."
else
ln -sv $SELF_PATH/$src_file $dest_file
fi
done
# install launchd services
heading "[launchd] installing launcd services..."
for file in `find $SELF_PATH/services -maxdepth 1 -name \*.plist`; do
file_name=$(basename $file)
dest_file="$HOME/Library/LaunchAgents/$file_name"
if [ -e $dest_file ]
then
warning "$dest_file already exists; skipping it..."
else
ln -s "$SELF_PATH/services/$file_name" "$dest_file"
user_id=$(id -u)
sudo launchctl bootstrap gui/"$user_id" $dest_file
fi
done
# installing espanso configs from icloud drive
heading "[configs] installing icloud drive symlinks..."
ln -sv "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Backups/.aws" "$HOME/.aws"
heading "[configs] installing app configurations..."
ln -sv "$HOME/.config/fish" "$HOME/.config/fish"
ln -sv "$HOME/.config/nvim" "$HOME/.config/nvim"
ln -sv "$HOME/.config/wezterm" "$HOME/.config/wezterm"