-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·89 lines (73 loc) · 1.47 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env bash
# shamelessy stolen from:
# https://dev.to/writingcode/how-i-manage-my-dotfiles-using-gnu-stow-4l59
# make sure we have pulled in and updated any submodules
git submodule init
git submodule update
# what directories should be installable by all machines
base=(
git
spacemacs
email
vim
tmux
misc
zsh
)
darwin_only=(
darwin
)
linux_only=(
bash
linux
)
groot_only=(
groot
)
laptop_only=(
laptop
)
# run the stow command for the passed in directory ($2) in location $1
stowit() {
local usr
local app
usr=$1
app=$2
stow --restow --target=${usr} ${app}
}
echo ""
echo "Stowing apps for user: $(whoami)"
# install apps available to local users
for app in ${base[@]}; do
stowit "${HOME}" $app
done
echo ""
echo "Stowing apps for $(uname)"
# install only user for darwin (MacOS)
if [[ $(uname) = 'Darwin' ]]; then
for app in ${darwin_only[@]}; do
stowit "${HOME}" $app
done
fi
# install only for Linux
if [[ $(uname) = 'Linux' ]]; then
for app in ${linux_only[@]}; do
stowit "${HOME}" $app
done
fi
echo ""
echo "Stowing apps for $(hostname)"
# install only for groot desktop
if [[ $(hostname) = 'groot' ]]; then
for app in ${groot_only[@]}; do
stowit "${HOME}" $app
done
fi
# install only for laptop
if [[ $(hostname) = 'mkorpershoek-xps13' ]]; then
for app in ${laptop_only[@]}; do
stowit "${HOME}" $app
done
fi
echo ""
echo "##### ALL DONE"