-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-system
executable file
·56 lines (52 loc) · 1.21 KB
/
install-system
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
#!/usr/bin/env bash
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source /etc/os-release
Help() {
echo "install-system - install Charitarth Chugh's dev environment"
echo " "
echo "Default is to install non GUI applications"
echo " "
echo "usage install-system [arguments]"
echo " "
echo "options:"
echo "-h, show this help message and exit"
echo "-g, install GUI applications as well"
echo
}
# Get the options
while getopts ":hg" option; do
case $option in
h) # display Help
Help
exit
;;
g)
GUI=true
;;
\?) # Invalid option
echo "Error: Invalid option"
exit
;;
esac
done
# Detect system and install respective cli packages
if [[ "$ID" = "ubuntu" ]]; then
$BASEDIR/scripts/apt-cli.sh
elif [[ "$ID" = "arch" ]]; then
$BASEDIR/scripts/yay-cli.sh
elif [[ "$ID" = "fedora" ]]; then
$BASEDIR/scripts/dnf-cli.sh
fi
$BASEDIR/install # Install Dotfiles
if [ -z "$GUI" ]; then
exit 0
fi
# Install respective gui packages
if [[ "$ID" = "ubuntu" ]]; then
$BASEDIR/scripts/apt-gui.sh
elif [[ "$ID" = "arch" ]]; then
$BASEDIR/scripts/yay-gui.sh
elif [[ "$ID" = "fedora" ]]; then
$BASEDIR/scripts/dnf-gui.sh
fi
$BASEDIR/scripts/flatpak.sh