forked from acornejo/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.hook-post
95 lines (86 loc) · 2.66 KB
/
.hook-post
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
#!/bin/bash
onexit() {
echo "Skip package install"
exit 1
}
install_brew() {
if ! hash brew 2>/dev/null; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
}
install_cask() {
install_brew
brew tap phinze/cask
brew install brew-cask
}
if hash git 2>/dev/null; then
git config --global include.path "~/.gitconfig.common"
fi
trap onexit 1 2 3 15 ERR
echo "Install basic packages? [git, tmux, vim, curl, wget, zsh]"
select yn in "Yes" "No"; do
case $yn in
Yes )
if [ "$UNAME" == "Darwin" ]; then
install_brew
brew install tmux reattach-to-user-namespace htop wget bash bash-completion w3m the_silver_searcher zsh
test -f /usr/local/bin/bash && echo /usr/local/bin/bash | sudo tee -a /etc/shells && chsh -s /usr/local/bin/bash
sudo ln -sf /usr/local/bin/tmux /usr/bin
sudo ln -sf /usr/local/bin/reattach-to-user-namespace /usr/bin
install_cask
brew cask install macvim slate
else
sudo apt-get install tmux vim htop git curl wget bash bash-completion w3m silversearcher-ag zsh
sudo apt-get install --no-install-recommends
fi
break;;
No )
break;;
esac
done
echo "Install extra packages? [chrome, dropbox, gimp, vlc, latex]"
select yn in "Yes" "No"; do
case $yn in
Yes )
if [ "$UNAME" == "Darwin" ]; then
install_cask
brew cask install google-chrome google-hangouts dropbox gimp vlc basictex
echo Inkscape must be installed manually.
else
apt-get install google-chrome latex-beamer inkscape gimp vlc texlive-latex-extra
echo Dropbox and google-talk plugin must be installed manually.
fi
break;;
No )
break;;
esac
done
echo "Configure git?"
select yn in "Yes" "No"; do
case $yn in
Yes )
git config --global include.path "~/.gitconfig.common"
echo -n "Full name: "
read name
echo -n "Email: "
read email
git config --global user.name "$name"
git config --global user.email $email
break;;
No )
break;;
esac
done
echo "Import ssh keys and config?"
select yn in "Yes" "No"; do
case $yn in
Yes )
echo -n "Server name: "
read server
mkdir -p ~/.ssh
scp $server:".ssh/id_* .ssh/config" ~/.ssh
break;;
No )
break;;
esac
done