-
Notifications
You must be signed in to change notification settings - Fork 4
/
install_vividhues.sh
103 lines (82 loc) · 3.94 KB
/
install_vividhues.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
#!/bin/bash
# Kenneth Oliver ©2022
alert_noise() {
printf "\a"
}
NORMAL=$(tput sgr0)
# 3 bits => only 7 possible colors!
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
ORANGE=$(tput setaf 3) # appears yellow (at least on Windows)
BLUE=$(tput setaf 4)
PURPLE=$(tput setaf 5)
CYAN=$(tput setaf 6)
alert_noise
printf "${CYAN}\
${RED}██╗░░░██╗${ORANGE}██╗${GREEN}██╗░░░██╗${CYAN}██╗${BLUE}██████╗░${PURPLE}██╗░░██╗${RED}██╗░░░██╗${ORANGE}███████╗${GREEN}░██████╗
${RED}██║░░░██║${ORANGE}██║${GREEN}██║░░░██║${CYAN}██║${BLUE}██╔══██╗${PURPLE}██║░░██║${RED}██║░░░██║${ORANGE}██╔════╝${GREEN}██╔════╝
${RED}╚██╗░██╔╝${ORANGE}██║${GREEN}╚██╗░██╔╝${CYAN}██║${BLUE}██║░░██║${PURPLE}███████║${RED}██║░░░██║${ORANGE}█████╗░░${GREEN}╚█████╗░
${RED}░╚████╔╝░${ORANGE}██║${GREEN}░╚████╔╝░${CYAN}██║${BLUE}██║░░██║${PURPLE}██╔══██║${RED}██║░░░██║${ORANGE}██╔══╝░░${GREEN}░╚═══██╗
${RED}░░╚██╔╝░░${ORANGE}██║${GREEN}░░╚██╔╝░░${CYAN}██║${BLUE}██████╔╝${PURPLE}██║░░██║${RED}╚██████╔╝${ORANGE}███████╗${GREEN}██████╔╝
${RED}░░░╚═╝░░░${ORANGE}╚═╝${GREEN}░░░╚═╝░░░${CYAN}╚═╝${BLUE}╚═════╝░${PURPLE}╚═╝░░╚═╝${RED}░╚═════╝░${ORANGE}╚══════╝${GREEN}╚═════╝░${NORMAL}
█▄▀ █▀▀ █▄ █ █▄ █ █▄█ █▀█ █ █ █ █ █▀▀ █▀█
█ █ ██▄ █ ▀█ █ ▀█ █ █▄█ █▄▄ █ ▀▄▀ ██▄ █▀▄
\n"
printf '%.0s—' {1..65}
printf "\n\n"
printf "${PURPLE}VividHues Instant Installer — Kenneth Oliver ©2022${NORMAL}\n\n"
sleep .5
printf "Hi there! 👋\r"
sleep 1
# (the below) cannot be part of if statement,
# otherwise it thinks VividHues is never installed
pip show VividHues 1>/dev/null
if [ $? == 0 ]; then
# python -c "import VividHues; print(VividHues.__version__)"
printf "VividHues is already installed! :P\n"
printf "${CYAN}Would you like to update VividHues?\n"
updatingPackage="True"
else
printf "VividHues isn't installed yet! :o\n"
printf "${CYAN}Would you like to install VividHues?\n"
updatingPackage="False"
fi
printf " (y/n) --> ${NORMAL}"
read -r choice
choice=${choice,,} # all lowercase
printf "${CYAN}👉 You chose "
case "$choice" in
y|Y ) printf "yes";;
n|N ) printf "no";;
* ) printf "an invalid choice";;
esac
printf "!${NORMAL}\n\n"
sleep .5
if [[ $choice == y* ]]; then
if [ $updatingPackage == "True" ]; then
printf "Looks like we're updating VividHues!!! 👍\n"
printf "$BLUE"
pip install --upgrade VividHues --disable-pip-version-check &>/dev/null
# &>/dev/null is used to redirect stdout to null
# so that output is "hidden"
printf "$NORMAL"
else
printf "Looks like we're installing VividHues!!! 👍\n\n"
printf "$BLUE"
pip install VividHues --disable-pip-version-check
printf "$NORMAL"
fi
printf "\n"
printf '%.0s—' {1..65}
printf "\n\n"
printf "${ORANGE}Success! Have colorful fun! 🌈 📦${NORMAL}\n"
printf "\n"
alert_noise
sleep 2
fi
printf "Press enter to exit!\n"
read -r pressEnterToExit # unused variable, but exists for enter to exit
printf "Bye! 👋\n"
alert_noise
sleep 1.5