-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·72 lines (54 loc) · 1.32 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
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# to enable debug trace
# set -x
# execute when inside the directory containing the actual files
git submodule update --init --recursive
BASE=$PWD
# sed removes the lines containing '#' assuming a comment
cat $BASE/fileList | sed '/#.*$/d' | while read l
do
echo "l = $l";
if [[ "$l" == "" ]]; then
echo "Skipping empty line: $l"
continue;
fi;
# first is source, 2nd destination
SF=$(echo $l | awk '{print $1}')
SF="${BASE}/${SF}"
DF=$(echo $l | awk '{print $2}')
DF="${HOME}/${DF}"
if [[ -z "$SF" ]]; then
echo "Bad line with empty col 1: $l";
exit -1;
fi
if [[ -z "$DF" ]]; then
echo "Bad line with empty col 2: $l";
exit -1;
fi
echo "SF=$SF, DF=$DF";
# if is a symbolic link
if [ -h "$DF" ]; then
echo "removing symbolic link $DF"
rm "$DF"
else
DF_BAK="${DF}.bak"
echo "backing up ${DF} to ${DF_BAK}"
mv "$DF" "$DF_BAK"
fi
echo "linking to $SF from $DF"
ln -s "$SF" "$DF"
done
VIM_BAKDIR="$HOME/.backup"
# make a .backup dir for storing vim backups
mkdir $VIM_BAKDIR
# zsh powerlevel10k theme
if [[ -d $PWD/zsh/powerlevel10k ]]; then
ln -s $PWD/zsh/powerlevel10k/ $PWD/zsh/oh-my-zsh/themes/powerlevel10k
fi
# kwinrc settings
cat >> $HOME/.config/kwinrc <<HERE
[Windows]
BorderlessMaximizedWindows=true
HERE
# update font cache
fc-cache