-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-links.sh
executable file
·43 lines (36 loc) · 1.39 KB
/
make-links.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
#/!/bin/bash
set -euo pipefail
BASETARGET=${1:-$HOME}
TARGET=$BASETARGET/.config
mkdir -p $TARGET
WD=$(pwd)
for dir in ./config/*; do
dir=${dir%*/}
dir=${dir##*/}
[[ -L "$TARGET/$dir" ]] && rm "$TARGET/$dir"
[[ -e "$TARGET/$dir" ]] && echo "Skipping $TARGET/$dir"
ln -s $WD/config/$dir $TARGET/$dir
[[ -x "$TARGET/$dir/setup" ]] && $TARGET/$dir/setup "$@"
done
for ti in ./.terminfo-italic-fix/*.ti; do
tic $ti
done
mkdir -p $BASETARGET/.local/bin
for bin in ./bin/*; do
bin=${bin##*/}
[[ -L "$BASETARGET/.local/bin/$bin" ]] && rm "$BASETARGET/.local/bin/$bin"
[[ -e "$BASETARGET/.local/bin/$bin" ]] && echo "Skipping $BASETARGET/.local/bin/$bin"
ln -s $WD/bin/$bin $BASETARGET/.local/bin/$bin
done
mkdir -p $BASETARGET/.local/share/applications
for app in ./applications/*; do
app=${app##*/}
[[ -L "$BASETARGET/.local/share/applications/$app" ]] && rm "$BASETARGET/.local/share/applications/$app"
[[ -e "$BASETARGET/.local/share/applications/$app" ]] && echo "Skipping $BASETARGET/.local/share/applications/$bin"
ln -s $WD/applications/$app $BASETARGET/.local/share/applications/$app
done
update-desktop-database $BASETARGET/.local/share/applications
[[ ! -d $TARGET/kak/plugins ]] && mkdir $TARGET/kak/plugins
[[ -L "$BASETARGET/.ssh" ]] && rm "$BASETARGET/.ssh"
[[ -e "$BASETARGET/.ssh" ]] && echo "Skipping $BASETARGET/.ssh"
ln -s $WD/ssh $BASETARGET/.ssh