-
Notifications
You must be signed in to change notification settings - Fork 2
/
basicWF.sh
executable file
·97 lines (79 loc) · 2.23 KB
/
basicWF.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
90
91
92
93
94
95
96
97
#!/bin/bash
# Sets up my basic workflow, install packages, configures some other packages.
# shellcheck disable=SC1090
# shellcheck disable=SC1091
if [ "$#" = 0 ]; then
ALL=1
else
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
pacman | -p | --pacman)
PACMAN=1
;;
aur | -a | --aur)
AUR=1
;;
cargo | -c | --cargo)
CARGO=1
;;
python | -y | --python)
PYTHON=1
;;
esac
shift
done
fi
pac() { [ "$ALL" = 1 ] || [ "$PACMAN" = 1 ]; }
aur() { [ "$ALL" = 1 ] || [ "$AUR" = 1 ]; }
carg() { [ "$ALL" = 1 ] || [ "$CARGO" = 1 ]; }
pytho() { [ "$ALL" = 1 ] || [ "$PYTHON" = 1 ]; }
script_dir="$(dirname "$(realpath "$0")")"
. "$script_dir/../runes/bash/profile"
packages=()
aurpackages=()
bloat=()
cargopackages=()
pythonpackages=()
. "$script_dir"/packages.sh
sudo() { echo "$PASSWORD" | command sudo -S true && command sudo "$@"; }
read -r -s -p "[sudo] password for $LOGNAME: " PASSWORD
pac && sudo pacman -S --quiet --noconfirm --needed "${packages[@]}"
pac && for package in "${bloat[@]}"; do
[ "$(pacman -Q --quiet "$package")" = "$package" ] &&
sudo pacman -Rsn --noconfirm "$package"
done
# Dash
pac && sudo ln -sf /usr/bin/dash /usr/bin/sh
# (AUR manager)
aur && {
mkdir tmp
(
cd tmp || exit 1
git clone https://github.com/jtexeira/tiny-aura.git
(cd tiny-aura || exit 1 && sudo make)
for i in "${aurpackages[@]}"; do
pacman -Qq "$i" || (
echo "INSTALLING AUR PKG: $i"
git clone https://aur.archlinux.org/"$i"
cd "$i" || exit 1
echo "$PASSWORD" | command sudo -S true
makepkg --syncdeps --install --noconfirm --skippgpcheck --clean
)
done
)
rm -rf tmp
}
## NEOVIM
pac && nvim -c PlugInstall -c qall
carg && {
rustup default stable &&
cargo install --force "${cargopackages[@]}"
}
pytho && {
sudo pip install "${pythonpackages[@]}"
}
sudo systemctl enable cronie
sudo systemctl enable NetworkManager
cd "$script_dir" || exit 1
../spells/syncspellbook.spell --nocommit