-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathinstall.sh
109 lines (91 loc) Β· 3.63 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
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
#!/usr/bin/env bash
# Source the library that enables simple prompt for the user to understand
# what the script will do and if they want to really run the functions
source ./lib/prompt.sh
# Install packages using arch linux package manager.
# Pacman will install yay which is useful to install community packages
arch_install() {
pacman -S yay
yay -S $(cat packages_arch.txt)
}
# Create default directories in home (bin, dev, etc, tmp, work)
mkdirectories() {
mkdir $HOME/{bin,dev,etc,tmp,work} -p
}
polybar_plugins() {
git clone [email protected]:marioortizmanero/polybar-pulseaudio-control.git ~/etc/polybar-pulseaudio-control
}
# Link all the dotfiles
link_dotfiles() {
mkdir -p $HOME/.zsh
mkdir -p $HOME/.vim
ln -sf $HOME/etc/dotfiles/config/fish/ $HOME/.config/fish
ln -sf $HOME/etc/dotfiles/zsh/aliases.zsh $HOME/.zsh/aliases.zsh
ln -sf $HOME/etc/dotfiles/zsh/prompt.zsh $HOME/.zsh/prompt.zsh
ln -sf $HOME/etc/dotfiles/tmux/tmux.conf $HOME/.tmux.conf
ln -sf $HOME/etc/dotfiles/vim/vimrc $HOME/.vim/vimrc
ln -sf $HOME/etc/dotfiles/git/gitconfig $HOME/.gitconfig
ln -sf $HOME/etc/dotfiles/git/gitignore_global $HOME/.gitignore_global
ln -sf $HOME/etc/dotfiles/git/git_commit_template $HOME/.git_commit_template
ln -sf $HOME/etc/dotfiles/git/gitconfig-work $HOME/.gitconfig-work
ln -sf $HOME/etc/dotfiles/git/git-templates $HOME/.git-templates
# TODO Is the sp script used now ?
ln -sf $HOME/etc/dotfiles/bin/sp $HOME/bin/sp
# TODO Check if I can remove this line
ln -sf $HOME/etc/dotfiles/bin/spotify-current $HOME/bin/spotify-current
ln -sf $HOME/etc/dotfiles/config/i3 $HOME/.config/
ln -sf $HOME/etc/dotfiles/Xresources $HOME/.Xresources
ln -sf $HOME/etc/dotfiles/config/rofi $HOME/.config/
ln -sf $HOME/etc/dotfiles/config/alacritty $HOME/.config/
ln -sf $HOME/etc/dotfiles/config/compton $HOME/.config/
ln -sf $HOME/etc/dotfiles/config/morc_menu $HOME/.config/
ln -sf $HOME/etc/dotfiles/.xbindkeysrc $HOME/.xbindkeysrc
}
set_shell() {
echo "Which shell do you want ? (bash/zsh/fish)"
read input
chsh -s $(which $input)
}
zsh_plugins() {
# Set zsh as the default shell
chsh -s $(which zsh)
# Color feedback about commands
mkdir -p $HOME/etc/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/etc/zsh-syntax-highlighting
# Commands suggestions based on history
mkdir -p $HOME/etc/zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-autosuggestions $HOME/etc/zsh-autosuggestions
# k is the new ls
mkdir -p $HOME/etc/k
git clone [email protected]:supercrabtree/k.git $HOME/etc/k
mkdir -p $HOME/etc/z
git clone [email protected]:rupa/z.git $HOME/etc/z
}
vim_install() {
hash git 2> /dev/null
if [ $? -eq 0 ]; then
echo "Installing Vundle"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
else
RERUN=$TRUE
fi
# Install all the plugins managed by Vundle
vim +PluginInstall +qall
}
scripts_install() {
# TODO Improve with a for loop
# Lock script
ln -sf $HOME/etc/dotfiles/bin/lock $HOME/bin
# Volume script
ln -sf $HOME/etc/dotfiles/bin/vol $HOME/bin
}
main() {
prompt "Create defaults folders (bin, dev, etc, tmp)" "Creating..." "Not creating" mkdirectories
prompt "Is pacman available" "Installing dependencies" "Not installing" arch_install
prompt "Link the dotfiles" "Linking dotfiles" "Not linking dotfiles" link_dotfiles
prompt "Set a new shell" "Setting new shell" "Pass" set_shell
prompt "Install zsh plugins" "Installing zsh plugins" "Not installing" zsh_plugins
prompt "Install vim plugins" "Installing Vim plugins" "Not installing" vim_install
scripts_install
}
main