-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·61 lines (49 loc) · 1.48 KB
/
install
File metadata and controls
executable file
·61 lines (49 loc) · 1.48 KB
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
#!/bin/bash
# This script symlinks all dotfiles to the home directory
if [ "$(basename "$(pwd)")" != "dotfiles" ]; then
echo "Please run this script in dotfiles directory"
exit 1
fi
home_dots=$(find . -name ".*" -type f -maxdepth 1 -exec basename {} \;)
# list of directories belonging in .config
config_dots=("kitty nvim yay dunst polybar ranger picom i3 i3status rofi")
# assert that all directories in config_dots exist
for d in $config_dots; do
if [ ! -d "$d" ]; then
echo "Directory $d does not exist"
exit 1
fi
done
# home dotfiles
for f in $home_dots; do
echo "symlinking $(pwd)/$f to ~/$f"
ln -s "$(pwd)/$f" ~/"$f"
done
# .configs
for d in $config_dots; do
echo "symlinking $(pwd)/$d to ~/.config/$d"
if [ -d ~/.config/"$d" ]; then
rm -r ~/.config/"$d"
fi
ln -s "$(pwd)"/"$d" ~/.config/"$d"
done
# bins
echo "symlinking $(pwd)/bin to ~/.local/bin"
ln -s "$(pwd)/bin" ~/.local
##### SUDO LINKS REQUIRED PAST THIS POINT #####
if [ "$EUID" -ne 0 ]; then
echo ""
echo ""
echo -e "\tPlease run this script as root to symlink btrbk and pacman snapshot hooks"
echo ""
echo ""
exit 1
fi
# btrbk config
echo "symlinking $(pwd)/btrbk/btrbk.conf to /etc/btrbk.conf"
ln -s "$(pwd)/btrbk/btrbk.conf" /etc/btrbk/btrbk.conf
echo "symlinking $(pwd)/btrbk/btrbk.external.conf to /etc/btrbk.external.conf"
ln -s "$(pwd)/btrbk/btrbk.external.conf" /etc/btrbk/btrbk.external.conf
# pacman hooks
echo "symlinking $(pwd)/pacman to /etc/pacman.d/hooks"
ln -s "$(pwd)/pacman" /etc/pacman.d/hooks