-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·66 lines (55 loc) · 1.78 KB
/
bootstrap.sh
File metadata and controls
executable file
·66 lines (55 loc) · 1.78 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
#!/bin/bash
set -e
DOTFILES_ROOT="$(pwd)"
info() {
printf " [ \033[00;34m..\033[0m ] $1\n"
}
success() {
printf "\r\033[2K [ \033[00;32m0K\033[0m ] $1\n"
}
link_files() {
ln -f -s "$1" "$2"
success "linked $1 to $2"
}
sudo_link_files() {
sudo ln -f -s "$1" "$2"
success "linked $1 to $2"
}
install_dotfiles() {
for file in $(find $DOTFILES_ROOT -maxdepth 2 -name \*.symlink)
do
dest="$HOME/.$(basename ${file%.*})"
if [ -f "$dest" ] || [ -d "$dest" ]; then
mkdir -p "$HOME/backup"
info "Moved original $dest to $HOME/backup"
mv "$dest" "$HOME/backup"
fi
rm -rf "$dest"
link_files "$file" "$dest"
done
link_clipit
}
link_clipit() {
rm -rf "$HOME/.local/share/clipit/"
rm -rf "$HOME/.config/clipit/"
mkdir -p "$HOME/.local/share/clipit/"
mkdir -p "$HOME/.config/clipit/"
link_files "$DOTFILES_ROOT/clipit/actions" "$HOME/.local/share/clipit/actions"
link_files "$DOTFILES_ROOT/clipit/clipitrc" "$HOME/.config/clipit/clipitrc"
}
install_dotfiles_root() {
sudo_link_files "$DOTFILES_ROOT/fonts.symlink" "/root/.fonts"
sudo_link_files "$DOTFILES_ROOT/themes.symlink" "/root/.themes"
sudo_link_files "$DOTFILES_ROOT/zshrc.symlink" "/root/.zshrc"
sudo_link_files "$DOTFILES_ROOT/bashrc.symlink" "/root/.bashrc"
sudo_link_files "$DOTFILES_ROOT/aliases.symlink" "/root/.aliases"
sudo_link_files "$HOME/.oh-my-zsh" "/root/.oh-my-zsh"
sudo_link_files "$DOTFILES_ROOT/gtkrc-2.0.symlink" "/root/.gtkrc-2.0"
}
install_dotfiles
#install_dotfiles_root
git clone https://github.com/ohmyzsh/ohmyzsh.git "$HOME/.oh-my-zsh" --depth 1
sh -s /bin/zsh
git clone https://github.com/junegunn/fzf.git "$HOME/.fzf" --depth 1
"$HOME/.fzf/install"
success "All installed!"