-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_linux.sh
executable file
·101 lines (84 loc) · 2.35 KB
/
install_linux.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
#!/bin/sh
DOTFILES="$HOME/.dotfiles"
DISTRO=$(cat /etc/issue | cut -f 1 -d ' ')
NOTES=$(cat << EOF
###########################################################################
#
# NOTES
#
###########################################################################
EOF
)
lnif() {
if [ -f $2 ]; then
echo "Ignoring $1, file exists ($2)"
return
fi
if [ -h $2 ]; then
rm $2
fi
ln -s $1 $2
}
install_package() {
echo "Installing package: ${1}"
case $DISTRO in
Ubuntu)
sudo apt-get install -y "$1"
;;
*)
echo "Unrecognized distro, cowardly giving up"
exit 1
;;
esac
}
# tmux
which tmux || install_package tmux
lnif $DOTFILES/tmux/tmux.conf $HOME/.tmux.conf
mkdir -p $HOME/.tmux
lnif $DOTFILES/tmux/tmux-linux.conf $HOME/.tmux/tmux-linux.conf
lnif $DOTFILES/tmux/tmux-osx.conf $HOME/.tmux/tmux--osx.conf
# zsh
which zsh || install_package zsh
lnif $DOTFILES/zsh/zshrc $HOME/.zshrc
chsh $USER --shell $(which zsh)
# vim
which vim || install_package vim
which ctags || install_package exuberant-ctags
mkdir -p $HOME/.vim/bundle
lnif $DOTFILES/vimrc $HOME/.vimrc
lnif $DOTFILES/vim/vundle.vim $HOME/.vim/vundle.vim
lnif $DOTFILES/vim/after $HOME/.vim/after
lnif $DOTFILES/vim/UltiSnips $HOME/.vim/UltiSnips
# powerline
which pip3 || install_package python3-pip
mkdir -p $HOME/.config
lnif $DOTFILES/powerline $HOME/.config/powerline
pip3 install --user powerline-status
# alacritty
lnif $DOTFILES/alacritty $HOME/.config/alacritty
if [ ! -e $HOME/.vim/bundle/Vundle.vim/autoload ]; then
echo "Installing Vundle"
git clone https://github.com/gmarik/Vundle.vim $HOME/.vim/bundle/Vundle.vim
fi
echo "Update/Install plugins using vundle"
vim -u $DOTFILES/vimrc +BundleInstall! +BundleClean +qall
# jupyter
lnif $DOTFILES/jupyter/nbextensions $HOME/.local/share/jupyter/nbextensions
# xmodmap
# Remap Cap-Locks to control
NOTES=$(cat << EOF
${NOTES}
xmodmap: Remember to add XModMap to start up:
Ubuntu: System->Preferences->Session
Generic: Added `xmodmap ~/.Xmodmap` to ~/.xinitrc
EOF
)
lnif $DOTFILES/Xmodmap $HOME/.Xmodmap
# gitconfig
lnif $DOTFILES/gitconfig $HOME/.gitconfig
# install z
git clone https://github.com/rupa/z $DOTFILES/external/z
lnif $DOTFILES/external/z/z.sh $HOME/.local/bin/z
# install marker
python ${DOTFILES}/marker/install.py
echo ${NOTES}