-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·94 lines (81 loc) · 2.09 KB
/
install.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
#!/bin/sh -e
VERSION="v1.3.0"
error_msg() {
printf "\033[1;31m%s\033[0m\n" "$1"
exit 1
}
if [ "$(id -u)" -eq 0 ]; then
error_msg "Should not be ran as root !"
fi
DOTFILES="$HOME/jeev-dotfiles"
DOTFILES_CONFIG="$DOTFILES/.config"
CONFIG_DIR="$HOME/.config"
TEMP_FILE=$(mktemp) || error_msg "Cannot create temp file"
ESCALATION_TOOL=$(command -v doas || command -v sudo || error_msg "No escalation tool found")
curl -Lo "$TEMP_FILE" "https://github.com/jeevithakannan2/dotfiles/archive/refs/tags/${VERSION}.tar.gz"
mkdir -p "$DOTFILES"
tar xf "$TEMP_FILE" --strip-components=1 --directory="$DOTFILES"
cd "$DOTFILES"
mkdir -p "$CONFIG_DIR"
warning_msg() {
printf "\033[0;33m%s\033[0m\n" "$1"
}
info_msg() {
printf "\033[0;36m%s\033[0m\n" "$1"
}
success_msg() {
printf "\033[0;32m%s\033[0m\n" "$1"
}
backup() {
if [ -e "$1" ] || [ -d "$1" ]; then
info_msg "Creating backup $1 -> $1.bak"
cp -r "$1" "${1}.bak"
rm -rf "$1"
fi
}
prompt() {
info_msg "Jeev DotFiles Installer !!"
info_msg "Choose what to install"
info_msg "1. Hypr Catppuccin"
info_msg "2. Bash Prompt"
info_msg "3. QT theme Catppuccin"
info_msg "4. DWM Catppuccin"
info_msg "5. Nvim configuration"
info_msg "6. All of the above"
info_msg "0. Exit"
printf "Your choice [ 0-6 ]: "
read -r choice
}
prompt
while [ "$choice" != "0" ]; do
case "$choice" in
1)
. ./scripts/hypr.sh
;;
2)
. ./scripts/bash-prompt.sh
;;
3)
. ./scripts/qt-theme.sh
;;
4)
. ./scripts/dwm.sh
;;
5)
. ./scripts/nvim.sh
;;
6)
. ./scripts/hypr.sh
. ./scripts/qt-theme.sh
. ./scripts/bash-prompt.sh
. ./scripts/dwm.sh
. ./scripts/nvim.sh
;;
*)
error_msg "Invalid choice. Please enter a valid option !!"
;;
esac
prompt
done
rm -rf "$TEMP_FILE"
warning_msg "Exiting. Thank you for using Jeev DotFiles Installer !!"