-
Notifications
You must be signed in to change notification settings - Fork 5
/
link_configs.sh
executable file
·51 lines (40 loc) · 1.11 KB
/
link_configs.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
#!/bin/bash
# unlink and link files.
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
CONF_DIR=$THIS_DIR/ubuntu_configs
lnif() {
if [ -e "$2" ];then
unlink $2
fi
if [ -e "$1" ]; then
ln -sf "$1" "$2"
fi
}
# unlink and link .zshrc
echo ">>>> unlink and link ~/.zshrc"
SRC_ZSHRC=${CONF_DIR}/zshrc.sh
DIST_ZSHRC=${HOME}/.zshrc
lnif $SRC_ZSHRC $DIST_ZSHRC
# unlink and link .emacs.d
echo ">>>> unlink and link ~/.emacs.d"
SRC_EMACS=${THIS_DIR}/emacs.d
DIST_EMACS=${HOME}/.emacs.d
lnif $SRC_EMACS $DIST_EMACS
# unlink and link terminator conf
echo ">>>> unlink and link ~/.config/terminator/config"
if [ ! -d ${HOME}/.config/terminator ];then
mkdir -p ${HOME}/.config/terminator
fi
SRC_TERM=${CONF_DIR}/terminator.conf
DIST_TERM=${HOME}/.config/terminator/config
lnif $SRC_TERM $DIST_TERM
# unlink and link gitconfig
echo ">>>> unlink and link ~/.gitconfig"
SRC_TERM=${CONF_DIR}/gitconfig
DIST_TERM=${HOME}/.gitconfig
lnif $SRC_TERM $DIST_TERM
# unlink and link vimrc
echo ">>>> unlink and link ~/.vimrc"
SRC_TERM=${CONF_DIR}/vimrc
DIST_TERM=${HOME}/.vimrc
lnif $SRC_TERM $DIST_TERM