mirror of
https://github.com/KittyKatt/screenFetch.git
synced 2026-04-24 03:00:16 -04:00
Colors! :la:
This commit is contained in:
144
screenfetch-dev
144
screenfetch-dev
@@ -80,11 +80,59 @@ bold="\e[1m" # Bold Text
|
||||
underline="\e[4m" # Underline Text
|
||||
display_index=0
|
||||
|
||||
|
||||
|
||||
####################
|
||||
# Color Defines
|
||||
####################
|
||||
|
||||
detectColors() {
|
||||
my_lcolor=$(echo -n "$OPTARG" 2>/dev/null | awk -F',' '{ print $1 }')
|
||||
case $my_lcolor in
|
||||
0) export my_lcolor='\e[30m';;
|
||||
1) export my_lcolor='\e[31m';;
|
||||
2) export my_lcolor='\e[32m';;
|
||||
3) export my_lcolor='\e[33m';;
|
||||
4) export my_lcolor='\e[34m';;
|
||||
5) export my_lcolor='\e[35m';;
|
||||
6) export my_lcolor='\e[36m';;
|
||||
7) export my_lcolor='\e[37m';;
|
||||
8) export my_lcolor='\e[1;30m';;
|
||||
9) export my_lcolor='\e[1;31m';;
|
||||
10) export my_lcolor='\e[1;32m';;
|
||||
11) export my_lcolor='\e[1;33m';;
|
||||
12) export my_lcolor='\e[1;34m';;
|
||||
13) export my_lcolor='\e[1;35m';;
|
||||
14) export my_lcolor='\e[1;36m';;
|
||||
15) export my_lcolor='\e[1;37m';;
|
||||
esac
|
||||
my_hcolor=$(echo -n "$OPTARG" 2>/dev/null | awk -F',' '{ print $2 }')
|
||||
case $my_hcolor in
|
||||
0) export my_hcolor='\e[30m';;
|
||||
1) export my_hcolor='\e[31m';;
|
||||
2) export my_hcolor='\e[32m';;
|
||||
3) export my_hcolor='\e[33m';;
|
||||
4) export my_hcolor='\e[34m';;
|
||||
5) export my_hcolor='\e[35m';;
|
||||
6) export my_hcolor='\e[36m';;
|
||||
7) export my_hcolor='\e[37m';;
|
||||
8) export my_hcolor='\e[1;30m';;
|
||||
9) export my_hcolor='\e[1;31m';;
|
||||
10) export my_hcolor='\e[1;32m';;
|
||||
11) export my_hcolor='\e[1;33m';;
|
||||
12) export my_hcolor='\e[1;34m';;
|
||||
13) export my_hcolor='\e[1;35m';;
|
||||
14) export my_hcolor='\e[1;36m';;
|
||||
15) export my_hcolor='\e[1;37m';;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
#####################
|
||||
# Begin Flags Phase
|
||||
#####################
|
||||
|
||||
while getopts ":hsmevVntlc:D:o:B" flags; do
|
||||
while getopts ":hsmevVntlS:D:o:Bc:" flags; do
|
||||
case $flags in
|
||||
h)
|
||||
echo -e "${underline}Usage${c0}:"
|
||||
@@ -125,7 +173,7 @@ while getopts ":hsmevVntlc:D:o:B" flags; do
|
||||
echo -e " ${bold}-l${c0} Specify that you have a light background. This turns"
|
||||
echo -e " all white text into dark gray text (in ascii logos and"
|
||||
echo -e " in information output)."
|
||||
echo -e " ${bold}-c 'COMMAND'${c0} Here you can specify a custom screenshot command for"
|
||||
echo -e " ${bold}-S 'COMMAND'${c0} Here you can specify a custom screenshot command for"
|
||||
echo -e " the script to execute. Surrounding quotes are required."
|
||||
echo -e " ${bold}-D 'DISTRO'${c0} Here you can specify your distribution for the script"
|
||||
echo -e " to use. Surrounding quotes are required."
|
||||
@@ -134,6 +182,7 @@ while getopts ":hsmevVntlc:D:o:B" flags; do
|
||||
exit
|
||||
;;
|
||||
s) screenshot=1; continue;;
|
||||
S) screenCommand=$OPTARG; continue;;
|
||||
m) hostshot=1; continue;;
|
||||
e) exportTheme=1; continue;;
|
||||
v) verbosity=1; continue;;
|
||||
@@ -146,9 +195,10 @@ while getopts ":hsmevVntlc:D:o:B" flags; do
|
||||
;;
|
||||
D) distro=$OPTARG; continue;;
|
||||
t) truncateSet="Yes";;
|
||||
c) screenCommand=$OPTARG; continue;;
|
||||
n) display_type="Text";;
|
||||
o) overrideOpts=$OPTARG; continue;;
|
||||
# c) my_color=$(echo "$OPTARG" | awk -F',' '{ print $1 }'); my_bgcolor=$(echo "$OPTARG" | awk -F',' '{ print $2 }'); continue;;
|
||||
c) detectColors "$OPTARGS"; continue;;
|
||||
# d) overrideDisplay=$OPTARG; continue;;
|
||||
l) c1="\e[1;30m";;
|
||||
# B) background_detect="1"; continue;;
|
||||
@@ -705,8 +755,9 @@ asciiText () {
|
||||
# Distro logos and ASCII outputs
|
||||
case $distro in
|
||||
"Arch Linux - Old")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;34m" # Light Blue
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="0"
|
||||
fulloutput=("$c1 __ %s"
|
||||
"$c1 _=(SDGJT=_ %s"
|
||||
@@ -727,8 +778,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Arch Linux")
|
||||
[ -z $c1 ] && c1="\e[1;36m" # Light
|
||||
c1="\e[1;36m" # Light
|
||||
c2="\e[0;36m" # Dark
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("${c1} -\`"
|
||||
"${c1} .o+\` %s"
|
||||
@@ -752,8 +804,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Mint")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;32m" # Bold Green
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="0"
|
||||
fulloutput=("$c2 MMMMMMMMMMMMMMMMMMMMMMMMMmds+. %s"
|
||||
"$c2 MMm----::-://////////////oymNMd+\` %s"
|
||||
@@ -774,8 +827,9 @@ asciiText () {
|
||||
|
||||
|
||||
"LMDE")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;32m" # Bold Green
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=(" "${c1}"\`.-::---.."
|
||||
"${c2} .:++++ooooosssoo:. %s"
|
||||
@@ -797,9 +851,10 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Ubuntu")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;31m" # Light Red
|
||||
c3="\e[1;33m" # Bold Yellow
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("$c2 ./+o+-"
|
||||
"$c1 yyyyy- $c2-yyyyyy+ %s"
|
||||
@@ -822,8 +877,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Debian")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;31m" # Light Red
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=(" $c1 _,met\$\$\$\$\$gg."
|
||||
" $c1 ,g\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$P.\t %s"
|
||||
@@ -845,8 +901,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"CrunchBang")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;30m" # Dark Gray
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("$c1 ___ ___ _"
|
||||
"$c1 / / / / | | %s"
|
||||
@@ -868,8 +925,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Gentoo")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;35m" # Light Purple
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="2"
|
||||
fulloutput=("$c2 -/oyddmdhs+:."
|
||||
"$c2 -o"$c1"dNMMMMMMMMNNmhy+"$c2"-\`"
|
||||
@@ -892,8 +950,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Fedora")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;34m" # Light Blue
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("$c2 :/------------://"
|
||||
"$c2 :------------------:// %s"
|
||||
@@ -915,8 +974,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"BSD")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;31m" # Light Red
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="2"
|
||||
fulloutput=("$c2 , ,"
|
||||
"$c2 /( )\`"
|
||||
@@ -942,6 +1002,7 @@ asciiText () {
|
||||
"Mandriva"|"Mandrake")
|
||||
c1="\e[1;34m" # Light Blue
|
||||
c2="\e[1;33m" # Bold Yellow
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="0"
|
||||
fulloutput=("$c2 \`\` %s"
|
||||
"$c2 \`-. %s"
|
||||
@@ -963,6 +1024,7 @@ asciiText () {
|
||||
"openSUSE")
|
||||
c1="\e[1;32m" # Bold Green
|
||||
c2="\e[1;37m" # Bold White
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="2"
|
||||
fulloutput=("$c2 .;ldkO0000Okdl;."
|
||||
"$c2 .;d00xl:,'....';:ok00d;."
|
||||
@@ -985,8 +1047,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Slackware")
|
||||
[ -z $c1 ] && c1="\e[1;34m" # Light Blue
|
||||
c1="\e[1;34m" # Light Blue
|
||||
c2="\e[1;37m" # Bold White
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="3"
|
||||
fulloutput=("$c1 :::::::"
|
||||
"$c1 :::::::::::::::::::"
|
||||
@@ -1012,8 +1075,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Red Hat Linux")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;31m" # Light Red
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="0"
|
||||
fulloutput=("$c2 \`.-..........\` %s"
|
||||
"$c2 \`////////::.\`-/. %s"
|
||||
@@ -1034,8 +1098,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"Frugalware")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;36m" # Light Blue
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="5"
|
||||
fulloutput=("${c2} \`++/::-.\`"
|
||||
"${c2} /o+++++++++/::-.\`"
|
||||
@@ -1064,8 +1129,9 @@ asciiText () {
|
||||
|
||||
|
||||
"Peppermint")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;31m" # Light Red
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="2"
|
||||
fulloutput=("${c2} 8ZZZZZZ"${c1}"MMMMM"
|
||||
"${c2} .ZZZZZZZZZ"${c1}"MMMMMMM."
|
||||
@@ -1089,8 +1155,9 @@ asciiText () {
|
||||
;;
|
||||
|
||||
"SolusOS")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;30m" # Light Gray
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="2"
|
||||
fulloutput=("${c1} e e"
|
||||
"${c1} eee ee"
|
||||
@@ -1115,8 +1182,9 @@ asciiText () {
|
||||
|
||||
|
||||
"Mageia")
|
||||
[ -z $c1 ] && c1="\e[1;34m" # Light Blue
|
||||
c1="\e[1;34m" # Light Blue
|
||||
c2="\e[0;36m" # Light Cyan
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="2"
|
||||
fulloutput=("$c2 .'' "
|
||||
"$c2 '. .. "
|
||||
@@ -1141,8 +1209,9 @@ asciiText () {
|
||||
|
||||
|
||||
"ParabolaGNU")
|
||||
[ -z $c1 ] && c1="\e[1;35m" # Light Purple
|
||||
c1="\e[1;35m" # Light Purple
|
||||
c2="\e[1;37m" # White
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("${c1} eeeeeeeee"
|
||||
"${c1} eeeeeeeeeeeeeee %s"
|
||||
@@ -1165,8 +1234,9 @@ asciiText () {
|
||||
|
||||
|
||||
"Viperr")
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;30m" # Dark Gray
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("${c1} wwzapd dlzazw"
|
||||
"${c1} an"${c2}"#"${c1}"zncmqzepweeirzpas"${c2}"#"${c1}"xz %s"
|
||||
@@ -1189,7 +1259,8 @@ asciiText () {
|
||||
|
||||
|
||||
"LinuxDeepin")
|
||||
[ -z $c1 ] && c1="\e[1;32m" # Bold Green
|
||||
c1="\e[1;32m" # Bold Green
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
|
||||
startline="1"
|
||||
fulloutput=("${c1} eeeee eeeeee"
|
||||
"${c1} eeeeeee eeeeeee %s"
|
||||
@@ -1213,9 +1284,10 @@ asciiText () {
|
||||
|
||||
|
||||
*)
|
||||
[ -z $c1 ] && c1="\e[1;37m" # White
|
||||
c1="\e[1;37m" # White
|
||||
c2="\e[1;30m" # Light Gray
|
||||
c3="\e[1;33m" # Light Yellow
|
||||
if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
|
||||
startline="0"
|
||||
fulloutput=(" %s"
|
||||
" %s"
|
||||
@@ -1270,20 +1342,20 @@ asciiText () {
|
||||
}
|
||||
|
||||
infoDisplay () {
|
||||
if [ -z "$textcolor" ]; then textcolor="\e[0m"; fi
|
||||
textcolor="\e[0m"
|
||||
[[ "$my_hcolor" ]] && textcolor="${my_hcolor}"
|
||||
#TODO: Centralize colors and use them across the board so we only change them one place.
|
||||
if [ -z "$labelcolor" ]; then
|
||||
case $distro in
|
||||
"Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake") labelcolor="\e[1;34m";;
|
||||
"Arch Linux"|"Frugalware"|"Mageia") labelcolor="\e[1;36m";;
|
||||
"Mint"|"LMDE"|"openSUSE"|"LinuxDeepin") labelcolor="\e[1;32m";;
|
||||
"Ubuntu"|"Debian"|"BSD"|"Red Hat Linux"|"Peppermint") labelcolor="\e[1;31m";;
|
||||
"CrunchBang"|"SolusOS"|"Viperr") labelcolor="\e[1;30m";;
|
||||
"Gentoo"|"ParabolaGNU") labelcolor="\e[1;35m";;
|
||||
"Slackware") labelcolor="\e[1;34m";;
|
||||
*) labelcolor="\e[1;33m";;
|
||||
esac
|
||||
fi
|
||||
case $distro in
|
||||
"Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake") labelcolor="\e[1;34m";;
|
||||
"Arch Linux"|"Frugalware"|"Mageia") labelcolor="\e[1;36m";;
|
||||
"Mint"|"LMDE"|"openSUSE"|"LinuxDeepin") labelcolor="\e[1;32m";;
|
||||
"Ubuntu"|"Debian"|"BSD"|"Red Hat Linux"|"Peppermint") labelcolor="\e[1;31m";;
|
||||
"CrunchBang"|"SolusOS"|"Viperr") labelcolor="\e[1;30m";;
|
||||
"Gentoo"|"ParabolaGNU") labelcolor="\e[1;35m";;
|
||||
"Slackware") labelcolor="\e[1;34m";;
|
||||
*) labelcolor="\e[1;33m";;
|
||||
esac
|
||||
[[ "$my_lcolor" ]] && labelcolor="${my_lcolor}"
|
||||
# Some verbosity stuff
|
||||
[[ "$verbosity" == "1" ]] && [[ "$screenshot" == "1" ]] && verboseOut "Screenshot will be taken after info is displayed."
|
||||
[[ "$verbosity" == "1" ]] && [[ "$hostshot" == "1" ]] && verboseOut "Screenshot will be transferred/uploaded to specified location."
|
||||
|
||||
Reference in New Issue
Block a user