-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·47 lines (38 loc) · 1.08 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
#!/usr/bin/env bash
dotfiles_dir=$(pwd)
function link_dotfile {
dest="${HOME}/.${1}"
timestamp=$(date +%Y-%m-%d-%H%M)
if [ -h "${HOME}/${1}" ]; then
# Existing symlink
echo "Removing existing symlink: ${dest}"
rm "${dest}"
elif [ -f "${dest}" ]; then
# Existing file
echo "Backing up existing file: ${dest}"
mv "${dest}" "${dest}.${timestamp}"
elif [ -d "${dest}" ]; then
# Existing dir
echo "Backing up existing dir: ${dest}"
mv "${dest}" "${dest}.${timestamp}"
fi
echo "Creating new symlink: ${dest}"
ln -sf "${dotfiles_dir}/${1}" "${dest}"
}
link_dotfile config/awesome
link_dotfile config/spectrwm
link_dotfile config/markdownlint
link_dotfile config/systemd/user/geoclue-agent.service
link_dotfile config/user-dirs.dirs
link_dotfile config/gtk-3.0/gtk.css
link_dotfile bashrc
link_dotfile gitconfig
link_dotfile gitignore
link_dotfile profile
link_dotfile Xmodmap
link_dotfile Xresources
link_dotfile xinitrc
ln -sf "${HOME}/.xinitrc" "${HOME}/.xsession"
ln -sf "${HOME}/.xinitrc" "${HOME}/.xprofile"
link_dotfile vim
vim +PlugInstall +qall