-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·130 lines (101 loc) · 2.8 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·130 lines (101 loc) · 2.8 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
#!/usr/bin/env bash
#
#
# Initial setup script
#
#
echo ''
echo 'These scripts will make changes to your system packages and config.'
echo 'Review the content of the scripts before running them. Continue?'
read -n 1 -rp '[y/N] > ' CONTINUE_SETUP
if [[ "$CONTINUE_SETUP" != "y" ]]; then
echo 'Cancelled'
exit 0
fi
echo ''
if [ ! -d "$HOME/Dotfiles" ]; then
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "Adding symlink: '$HOME/Dotfiles' > '$REPO'"
ln -s "$REPO" "$HOME/Dotfiles"
else
echo "Skipped symlink, '$HOME/Dotfiles' already exists"
fi
source "$HOME/Dotfiles/bin/utils.sh"
REPO="$(dir_repo)"
OS="$(os)"
OSC="$(os_clean)"
OSD="$(os_desktop)"
OSDC="$(os_desktop_clean)"
cd "$REPO"
if [[ "$OS" == "Windows" ]]; then
error 'These scripts require either Linux or macOS.'
exit 0
fi
info 'Checking for custom config dir'
if [ -f "$REPO/.env" ]; then
source "$REPO/.env"
if [ -d "$DOTFILES_CONFIG_DIR" ]; then
if [ -d "$REPO/config" ]; then
warn "Skipped symlink, '$REPO/config' already exists"
else
success "Setup symlink: '$DOTFILES_CONFIG_DIR' > '$REPO/config'"
ln -s "$DOTFILES_CONFIG_DIR" "$REPO/config"
fi
else
error "Custom config dir '$DOTFILES_CONFIG_DIR' does not exist"
exit 0
fi
else
if [ -d "$REPO/config" ]; then
warn "File not found at '$REPO/.env', using '$REPO/config' for config"
else
error "File not found at '$REPO/.env' and '$REPO/config' does not exist."
exit 0
fi
fi
info 'Ensure required config sub-directories exist'
mkdir -p "$REPO/config/backups"
mkdir -p "$REPO/config/packages"
backup_config
info 'Setup Bash'
bash ~/Dotfiles/linux/bash/bash.sh
info 'Add Fonts'
bash ~/Dotfiles/fonts/fonts.sh
info 'Setup Homebrew'
bash ~/Dotfiles/homebrew/homebrew.sh
info 'Setup Just'
bash ~/Dotfiles/just/just.sh
info 'Setup Git'
bash ~/Dotfiles/dev/git/git.sh
info 'Setup Flatpak'
bash ~/Dotfiles/linux/packages/flatpak.sh
info 'Setup Keychron keyboards'
bash ~/Dotfiles/linux/hardware/keychron-keyboards.sh
info 'Setup Zed'
bash ~/Dotfiles/dev/zed/zed.sh
info 'Setup Vim'
bash ~/Dotfiles/linux/vim/vim.sh
info 'Setup Node'
bash ~/Dotfiles/dev/node.sh
info 'Setup Deno'
bash ~/Dotfiles/dev/deno.sh
info 'Setup Go'
bash ~/Dotfiles/dev/go.sh
info 'Setup Chrome'
bash ~/Dotfiles/linux/packages/chrome.sh
info 'Setup Docker'
bash ~/Dotfiles/dev/docker/docker.sh
DISTRO_SETUP_SCRIPT="$REPO/linux/distros/$OSC.sh"
if [[ -f "$DISTRO_SETUP_SCRIPT" ]]; then
warn "Running $OS setup from '$DISTRO_SETUP_SCRIPT'"
bash "$DISTRO_SETUP_SCRIPT"
fi
DESKENV_SETUP_SCRIPT="$REPO/linux/desktop-environments/$OSDC.sh"
if [[ -f "$DESKENV_SETUP_SCRIPT" ]]; then
warn "Running $OSD setup from '$DESKENV_SETUP_SCRIPT'"
bash "$DESKENV_SETUP_SCRIPT"
fi
info 'Setup Symlinks'
bash ~/Dotfiles/linux/symlinks/symlinks.sh
success 'Setup script completed.'
warn 'A reboot is recommended.'