-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·52 lines (42 loc) · 990 Bytes
/
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
#!/usr/bin/env bash
cfgs=(
config/autostart/Dropbox.desktop
config/autostart/KMix.desktop
config/autostart/Spotify.desktop
config/autostart/xfce4-volumed.desktop
config/autostart/XCompMGR.desktop
config/xfce4/helpers.rc
config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
gitconfig
nixpkgs
oh-my-zsh
synergy.conf
tmux.conf
xmonad
xsession
zshrc
)
with-home() {
pushd $HOME >/dev/null 2>&1
eval $@
popd >/dev/null 2>&1
}
cd $(dirname $0)
dotfilesdir=$PWD
now=$(date "+%F-%T")
echo $now >> $dotfilesdir/revert.log
for cfg in ${cfgs[@]}; do
cd $HOME
dst=.$cfg
src=$dotfilesdir/$cfg
if test -e $dst; then
echo "WARNING $dst already exists, creating backup"
mv -v $dst $dst.backup.$now
fi
dstdir=$(dirname $dst)
test -d "$dstdir" || mkdir -vp "$dstdir"
cd "$dstdir"
dst=$(basename $dst)
ln -sv $src $dst
done