Added Crunchbang ascii, better handling of '--image' and '--ascii' when used without args and better handling if ascii file isn't found

This commit is contained in:
Dylan 2016-01-29 17:40:49 +11:00
parent 569c420b3d
commit 7af2f7e483
2 changed files with 49 additions and 7 deletions

18
ascii/distro/crunchbang Normal file
View file

@ -0,0 +1,18 @@
"\
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}████████████████████████████${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
${c2} ${c1}███${c2} ${c1}███${c2} ${c1}███${c2}
"

38
fetch
View file

@ -545,7 +545,7 @@ getpackages () {
packages="$(xbps-query -l | wc -l)" packages="$(xbps-query -l | wc -l)"
;; ;;
"Ubuntu"* | "Mint"* | "Debian"* | "Kali Linux"* | "Deepin Linux"* | "elementary"*) "Ubuntu"* | "Mint"* | "CrunchBang"* | "Debian"* | "Kali Linux"* | "Deepin Linux"* | "elementary"*)
packages="$(dpkg --get-selections | grep -cv deinstall$)" packages="$(dpkg --get-selections | grep -cv deinstall$)"
;; ;;
@ -1300,7 +1300,7 @@ getascii () {
c2=$(color 1) c2=$(color 1)
;; ;;
"elementary"*) "elementary"* | "CrunchBang"*)
c1=$(color 7) c1=$(color 7)
;; ;;
@ -1413,9 +1413,9 @@ getascii () {
# Final directory # Final directory
ascii_dir="$(pwd -P)" ascii_dir="$(pwd -P)"
if [ -f "$ascii_dir/ascii/distro/${ascii/ *}" ]; then # If the ascii file doesn't exist
ascii="$ascii_dir/ascii/distro/${ascii/ *}" # fallback to text mode.
else if [ ! -f "$ascii_dir/ascii/distro/${ascii/ *}" ]; then
padding="\033[0C" padding="\033[0C"
image="off" image="off"
return return
@ -1441,6 +1441,14 @@ getascii () {
*) ascii_color="$(color $ascii_color)" ;; *) ascii_color="$(color $ascii_color)" ;;
esac esac
# If the ascii file doesn't exist
# fallback to text mode.
if [ ! -f "$ascii" ]; then
padding="\033[0C"
image="off"
return
fi
print="${ascii_color}$(<"$ascii")" print="${ascii_color}$(<"$ascii")"
fi fi
@ -1869,7 +1877,15 @@ while [ "$1" ]; do
# Image # Image
--image) image="$2" --image) image="$2"
[ -z "$2" ] && image="ascii" ;; [ -z "$2" ] && image="ascii"
case "$2" in
"--"*)
image="ascii"
;;
esac
;;
--image_backend) image_backend="$2" ;; --image_backend) image_backend="$2" ;;
--shuffle_dir) shuffle_dir="$2" ;; --shuffle_dir) shuffle_dir="$2" ;;
--font_width) font_width="$2" ;; --font_width) font_width="$2" ;;
@ -1884,7 +1900,15 @@ while [ "$1" ]; do
# Ascii # Ascii
--ascii) image="ascii"; ascii="$2" --ascii) image="ascii"; ascii="$2"
[ -z "$2" ] && ascii="distro" ;; [ -z "$2" ] && ascii="distro"
case "$2" in
"--"*)
ascii="distro"
;;
esac
;;
--ascii_color) ascii_color="$2" ;; --ascii_color) ascii_color="$2" ;;
--ascii_distro) ascii_distro="$2" ;; --ascii_distro) ascii_distro="$2" ;;