-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·44 lines (37 loc) · 1.03 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
#!/bin/bash
branch=$1
shell=$2
shopt -s expand_aliases
alias config='/usr/bin/git --git-dir=$HOME/.cfg --work-tree=$HOME'
dotconfig() {
echo ".cfg" >> .gitconfig
config stash -a
config init
config remote add origin https://github.com/mroberts14/dotfiles.git
config fetch origin
config config --local status.showUntrackedFiles no
config checkout $branch -f
}
zshconfig() {
if [[ -d "$HOME/.oh-my-zsh" ]]; then
echo "oh my zsh is already installed"
else
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
sh chsh -s $(which zsh) $(whoami)
fi
}
zshcustom() {
source $HOME/.zshrc
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
}
if [[ ! -d "$HOME/.cfg" ]]; then
dotconfig
else
rm -rf .cfg
dotconfig
fi
if [[ $shell == zsh ]]; then
zshconfig
zshcustom
fi