-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·50 lines (38 loc) · 1.2 KB
/
bootstrap.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
#!/usr/bin/env bash
source bash/.functions
function bootstrap() {
echo ""
rsync -avh --no-perms .vimrc .inputrc .gitconfig .shellcheckrc "$HOME"
echo ""
rsync -avh --no-perms --delete bash fish "$HOME/.config"
echo ""
rsync -avh --no-perms --delete nvim helix kitty alacritty starship/starship.toml "$HOME/.config"
echo ""
rsync -avh --no-perms --delete hypr sway sway swaync nwg-bar fuzzel waybar "$HOME/.config"
echo ""
rsync -avh --no-perms --delete chrome/chrome-flags.conf chrome/chromium-flags.conf "$HOME/.config"
# bash
ln -sf "$HOME/.config/bash/.bashrc" "$HOME/.bashrc"
ln -sf "$HOME/.config/bash/.bash_profile" "$HOME/.bash_profile"
# source .extra files
[[ -f .extra ]] && source .extra
[[ -f $HOME/.extra ]] && source "$HOME/.extra"
# init new shell
source "$HOME/.bashrc"
}
if ! command -v rsync &> /dev/null; then
echo "Error: rsync is not installed or available in PATH"
exit 1
fi
if [[ "$1" == "-f" || "$1" == "--force" ]]; then
backup
bootstrap
else
read -r -p "This may overwrite existing files in home and home/.cofnig directories. Are you sure? (y/n) " -n 1
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
backup
bootstrap
fi
fi
unset bootstrap