-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
executable file
·71 lines (50 loc) · 1.82 KB
/
start.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
#!/usr/bin/env bash
DOTFILES_ROOT=$(pwd)
echo "=============================="
echo "Starting MACHINE configuration"
echo "=============================="
sh "$DOTFILES_ROOT/homebrew/install.sh"
sh "$DOTFILES_ROOT/homebrew/apps.sh"
echo "====================="
echo "Installing Oh My Zsh!"
echo "====================="
# Remove already existing Oh My Zsh! folder
rm -r ~/.oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "============================="
echo "Starting settings of dotfiles"
echo "============================="
# Backup an existing .zshrc if exists
echo "Backing up an existing .zshrc config"
if [[ -f "$HOME/.zshrc" ]]; then
mv -v "$HOME/.zshrc" "$HOME/.zshrc.bak"
fi
ln -s -F -i "$DOTFILES_ROOT/zsh/.zshrc" "$HOME/.zshrc"
echo ".zshrc file added to home"
echo "==========================="
echo "Setting configuration files"
echo "==========================="
mkdir -p "$HOME/.config"
# Find all files and directories in the source directory
find "$DOTFILES_ROOT/.config" -mindepth 1 -print | while read -r file; do
# Determine the target path
target="$HOME/.config/${file#$DOTFILES_ROOT/.config/}"
# Create the parent directory for the target if it doesn't exist
mkdir -p "$(dirname "$target")"
# Create the symlink
ln -s "$file" "$target"
done
# Cleanup leftovers in the original folder
rm -rf "$DOTFILES_ROOT/.config/kitty/kitty"
rm -rf "$DOTFILES_ROOT/.config/gh/gh"
echo "Config files setup is done!"
echo "============================"
echo "Starting MacOS settings"
echo "============================"
# Creates a folder for Screenshots
mkdir -p "$HOME/Screenshots"
sh macos/defaults.sh
echo "MacOS settings is done!"
echo "=============================="
echo "MACHINE configuration is done!"
echo "=============================="