Repo Browser

bashcards/bashcards-android
cards/436391728247--firefly-banner-creator/assets/raw.sh
#!/usr/bin/env bash
set -euo pipefail;bash -c $'RED=\'\\033[0;31m\';GREEN=\'\\033[0;32m\';YELLOW=\'\\033[0;33m\'\nBLUE=\'\\033[0;34m\';CYAN=\'\\033[0;96m\';PURPLE=\'\\033[0;95m\'\nWHITE=\'\\033[1;37m\';RESET=\'\\033[0m\'\nC=(RED GREEN YELLOW BLUE CYAN PURPLE WHITE)\nT="${T:-Paperwork}"\nF="${F:-smslant}"\nBX="${BX:-yes}"\nclr(){ tput cnorm 2>/dev/null; clear; }\nneed(){ command -v "$1" >/dev/null 2>&1; }\np(){ read -r -p "Enter to continue... " _; }\nrender(){\n  local col="$1" code\n  case "$col" in\n    RED) code=$RED;; GREEN) code=$GREEN;; YELLOW) code=$YELLOW;;\n    BLUE) code=$BLUE;; CYAN) code=$CYAN;; PURPLE) code=$PURPLE;;\n    WHITE) code=$WHITE;; *) code=$RED;;\n  esac\n  echo -e "$code"\n  if need figlet; then\n    if [[ "$BX" == yes ]] && need boxes; then\n      figlet -f "$F" "$T" 2>/dev/null | boxes 2>/dev/null || figlet -f "$F" "$T"\n    else\n      figlet -f "$F" "$T" 2>/dev/null || figlet "$T"\n    fi\n  else\n    if [[ "$BX" == yes ]] && need boxes; then\n      printf "%s\\n" "$T" | boxes 2>/dev/null || printf "%s\\n" "$T"\n    else\n      printf "%s\\n" "$T"\n    fi\n  fi\n  echo -e "$RESET"\n}\nrand(){ render "${C[$((RANDOM%${#C[@]}))]}"; }\ncycle(){\n  while true; do\n    for x in "${C[@]}"; do clr; render "$x"; sleep 0.4; done\n  done\n}\nset_text(){\n  clr\n  read -r -p "Banner text: " T\n  [[ -z "${T:-}" ]] && T="Banner"\n}\nset_font(){\n  clr\n  if ! need figlet; then echo "figlet not installed"; p; return; fi\n  read -r -p "Figlet font (e.g. smslant, slant, standard): " F\n  [[ -z "${F:-}" ]] && F="standard"\n}\ntoggle_box(){\n  [[ "$BX" == yes ]] && BX=no || BX=yes\n}\nwhile true; do\n  clr\n  echo "BANNER MENU"\n  echo\n  echo "Text : $T"\n  echo "Font : $F"\n  echo "Box  : $BX"\n  echo\n  echo "1) Show random color"\n  echo "2) Cycle colors"\n  echo "3) Pick color"\n  echo "4) Set banner text"\n  echo "5) Set figlet font"\n  echo "6) Toggle boxes on/off"\n  echo "q) Quit"\n  echo\n  read -r -p "> " a\n  case "$a" in\n    1) clr; rand; p;;\n    2) cycle;;\n    3)\n      clr\n      echo "Choose color:"\n      select x in "${C[@]}"; do\n        [[ -n "$x" ]] && clr && render "$x" && break\n      done\n      p;;\n    4) set_text;;\n    5) set_font;;\n    6) toggle_box;;\n    q|Q) clr; exit 0;;\n  esac\ndone\n'
NameTypeSize
auto-art.pngfile1,020,327
back-data-url.txtfile217,902
back-thumb.pngfile153,478
back.pngfile163,410
front-data-url.txtfile289,698
front-thumb.pngfile130,333
front.pngfile217,256
manifest.txtfile184
qr-payload.txtfile1,355
raw.shfile2,273