-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·79 lines (64 loc) · 1.26 KB
/
setup.sh
File metadata and controls
executable file
·79 lines (64 loc) · 1.26 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
#
# CONFIGURATION
#
# Applications for all users (incl. root).
base=(
'zsh'
'vim'
)
# Applications for non-root users.
useronly=(
'git'
'i3'
'autorandr'
'compton'
'polybar'
'rofi'
'ipython'
'nvim'
'vim'
'kitty'
'latexmk'
)
#
# SCRIPT
#
# The base scrict diractory name.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
# The directory containing applications to deploy everywhere.
CONFIG_DIR=$SCRIPT_DIR/config
# Ensure all .sh are executable
find . -name "*.sh" -exec chmod +x {} \;
## Stowing files ---------------------------------------------------------------------
#
echo ""
echo "STOWING FILES"
# run the stow command for the passed in directory ($2) in location $1
stowit() {
usr=$1
app=$2
# -v verbose
# -R restow
# -t target
# --no-folding to prevent tree folding
stow -R --no-folding -t ${usr} -d "config" ${app}
}
## Stowing
USER=$(whoami)
echo ""
echo "Stowing apps for user: $USER"
# install apps available to local users and root
for app in ${base[@]}; do
echo $app
stowit "${HOME}" $app
done
# install only user space folders
if [[ ! "$(whoami)" = *"root"* ]]; then
for app in ${useronly[@]}; do
echo $app
stowit "${HOME}" $app
done
fi
echo ""
echo "##### ALL DONE"