-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·62 lines (60 loc) · 1.48 KB
/
setup.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
#!/bin/bash
declare -A links=(
# File
[bashrc]=~/.bashrc
[conkyrc]=~/.conkyrc
[i3blocks.conf]=~/.i3blocks.conf
[rtorrent.rc]=~/.rtorrent.rc
[screenrc]=~/.screenrc
[vimrc]=~/.vimrc
[xinitrc]=~/.xinitrc
[Xresources]=~/.Xresources
[zpreztorc]=~/.zpreztorc
[zshrc]=~/.zshrc
# Directory
[dunst]=~/.config/dunst
[bin]=~/.bin
[i3]=~/.config/i3
[img]=~/.background
[mpd]=~/.config/mpd
[mpv]=~/.config/mpv
[ncmpcpp]=~/.ncmpcpp
[openbox]=~/.config/openbox
[ranger]=~/.config/ranger
[terminator]=~/.config/terminator
[tint2]=~/.config/tint2
[zsh]=~/.zsh
)
mode=$1
if [ "$mode" = "clean" ]; then
echo "Removing links:"
for i in "${!links[@]}"
do
echo "rm ${!links[$i]}"
rm ${links[$i]}
done
elif [ "$mode" = "new" ]; then
echo "New installation:"
for i in "${!links[@]}"
do
if [ ! -h "${links[$i]}" ]
then
echo "$PWD/$i -> ${links[$i]}"
ln -s $PWD/$i ${links[$i]}
fi
done
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "Install minimun package:"
echo "Please run as root:"
echo "pacman -S `cat package-list.txt`"
else
echo "creating new links:"
for i in "${!links[@]}"
do
if [ ! -h "${links[$i]}" ]
then
echo "$PWD/$i -> ${links[$i]}"
ln -s $PWD/$i ${links[$i]}
fi
done
fi