-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot.sh
executable file
·46 lines (40 loc) · 983 Bytes
/
dot.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
#!/bin/bash
usage() { echo "No correct flag given" 1>&2; exit 1; }
fedora_dotfile=("nvim" "fish" "sway" "waybar")
mac_dotfile=("nvim" "fish")
install_all_dotfile() {
mkdir -p ~/.config
for f in ./.config/*; do
rm -f ~/.config/"$f"
cp -r "$f" ~/.config/
done
}
install_mac_dotfile() {
for f in "${mac_dotfile[@]}";do
rm -f ~/.config/"$f"
cp -r "$f" ~/.config/
done
}
install_generic_distro_dotfile() {
for f in "${fedora_dotfile[@]}";do
rm -f ~/.config/"$f"
cp -r "$f" ~/.config/
done
}
while getopts "uamg" arg; do
case $arg in
u)
echo "updating dotfiles";;
a)
echo "installing for new archlinux"
install_all_dotfile ;;
m)
echo "installing for new mac"
install_mac_dotfile;;
g)
echo "installing for generic distro"
install_generic_distro_dotfile;;
*)
usage;;
esac
done