-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·69 lines (53 loc) · 1.52 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
#!/bin/sh
if [ -z "$HOME" ]; then
echo "\$HOME is not set"
exit 1
fi
if [ ! -d "$HOME" ]; then
echo "\$HOME directory doesn't exist"
exit 1
fi
required_binaries="git node nvim tmux"
for binary in $required_binaries; do
if ! which $binary >/dev/null 2>&1; then
echo "${binary} not found"
exit 1
fi
done
mydir=$(realpath $(dirname $0 ))
os=$(uname -s)
conf_files="gitconfig git_template tmux.conf"
if [ -d "${HOME}/bin" ]; then
echo "${HOME}/bin is a directory, skipping... "
else
ln -sf $mydir/bin $HOME/
fi
if [ "$os" = "FreeBSD" ]; then
mkdir -p $HOME/.config/i3status $HOME/.config/sway
ln -sf $mydir/wallpaper.jpg $HOME/.wallpaper.jpg
ln -sf $mydir/i3status-config $HOME/.config/i3status/config
ln -sf $mydir/sway-config $HOME/.config/sway/config
# .login_conf is better being a hardlink
ln -f $mydir/login_conf $HOME/.login_conf
sudo mkdir -p /usr/local/etc/polkit-1/rules.d
sudo cp -f 60-garga.rules /usr/local/etc/polkit-1/rules.d
conf_files="${conf_files} XCompose"
fi
for conf_file in $conf_files; do
ln -sf $mydir/$conf_file $HOME/.$conf_file
done
if [ -d "${HOME}/.zprezto" ]; then
echo "${HOME}/.zprezto is a directory, skipping... "
else
if ! git clone --recursive [email protected]:rbgarga/prezto.git \
${HOME}/.zprezto; then
echo "Error cloning prezto"
exit 1
fi
git -C $HOME/.zprezto remote add upstream \
[email protected]:sorin-ionescu/prezto.git
for f in zlogin zlogout zpreztorc zprofile zshenv zshrc; do
ln -sf $HOME/.zprezto/runcoms/$f $HOME/.$f
done
fi
${mydir}/vim-install.sh