-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.sh
executable file
·128 lines (113 loc) · 4.48 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
STD='\033[0;0;39m'
NONE='\033[00m'
RED='\033[01;31m'
GREEN='\033[01;32m'
YELLOW='\033[01;33m'
PURPLE='\033[01;35m'
CYAN='\033[01;36m'
WHITE='\033[01;37m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
##################################
# Check OS
##################################
if [ -f /etc/os-release ]; then
# freedesktop.org and systemd
. /etc/os-release
OS=$NAME
elif type lsb_release >/dev/null 2>&1; then
# linuxbase.org
OS=$(lsb_release -si)
elif [ -f /etc/lsb-release ]; then
# For some versions of Debian/Ubuntu without lsb_release command
. /etc/lsb-release
OS=$DISTRIB_ID
elif [ -f /etc/debian_version ]; then
# Older Debian/Ubuntu/etc.
OS=Debian
else
# Fall back to uname, e.g. "Linux <version>", also works for BSD, etc.
OS=$(uname -s)
fi
if [[ "$OS" == "Arch Linux" || "$OS" == "Manjaro Linux" || "$OS" == "Darwin" ]]; then
echo ""
else
echo "This script is not made for $OS. Why in the world do you not use Arch?"
exit
fi
pause() {
read -rp "$*"
}
source ./.setup_scripts/cargo_packages.sh
if [[ "$OS" == "Arch Linux" || "$OS" == "Manjaro Linux" ]]; then
source ./.setup_scripts/arch.sh
show_menus() {
echo -e "${BOLD}――――――――――――――――――――――――――――――――――――"
echo " I N S T A L L - S T U F F for $OS"
echo -e "――――――――――――――――――――――――――――――――――――――${NONE}"
echo ""
echo "1. Install Packages"
echo "2. Setup Shell"
echo "3. Install and setup window manager"
echo "4. Install Fonts from patched fonts folder"
echo "5. Install Languge Tools"
echo "6. Install Cargo Packages"
echo "7. Exit"
}
read_options() {
local choice
read -rp "Enter choice [1 - 7]: " choice
case $choice in
1) install_packages ;;
2) install_shell ;;
3) install_wm ;;
4) install_fonts ;;
5) install_language_tools ;;
6) install_cargo_packages ;;
7) exit 0 ;;
*) echo -e "${RED}Please select a valid option${STD}" && sleep 1 ;;
esac
}
elif [[ "$OS" == "Darwin" ]]; then
source ./.setup_scripts/mac.sh
show_menus() {
echo -e "${BOLD}${GREEN}―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――"
cat << "EOF"
_____ _ _ _ _____ _ __ __ __ __ __ ____
|_ _| | | | | | / ____| | / _|/ _| / _| | \/ | / __ \
| | _ __ ___| |_ __ _| | | ______ | (___ | |_ _ _| |_| |_ | |_ ___ _ __ | \ / | __ _ ___| | | |___
| | | '_ \/ __| __/ _` | | | |______| \___ \| __| | | | _| _| | _/ _ \| '__| | |\/| |/ _` |/ __| | | / __|
_| |_| | | \__ \ || (_| | | | ____) | |_| |_| | | | | | || (_) | | | | | | (_| | (__| |__| \__ \
|_____|_| |_|___/\__\__,_|_|_| |_____/ \__|\__,_|_| |_| |_| \___/|_| |_| |_|\__,_|\___|\____/|___/
EOF
echo -e "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――${NONE}"
echo ""
echo "1. Install Packages"
echo "2. Setup Shell"
echo "3. Install Fonts from patched fonts folder"
echo "4. Install Languge Tools"
echo "5. Install Cargo Packages"
echo "6. Exit"
echo ""
}
read_options() {
local choice
read -rp "Enter choice [1 - 6]: " choice
case $choice in
1) install_packages ;;
2) install_shell ;;
3) install_fonts ;;
4) install_language_tools ;;
5) install_cargo_packages ;;
6) exit 0 ;;
*) echo -e "${RED}Please select a valid option${STD}" && sleep 1 ;;
esac
}
fi
# function to display menus
while true; do
clear
show_menus
read_options
done