#!/bin/sh
if [ ! -x /usr/bin/fastfetch ]; then
    echo "fastfetch: binary not found"
    exit 0
fi

echo "=== FASTFETCH BOOT SUMMARY ==="
# Keep output short/ASCII-ish so framebuffer text renderer can show it reliably.
/usr/bin/fastfetch --logo none 2>/dev/null \
  | /usr/bin/sed 's/[^[:print:]\t]//g' \
  | while IFS=: read -r key val; do
      case "$key" in
          OS|Kernel|Uptime|Packages|CPU|Memory|Swap|Battery|Locale|"Disk (/)")
              val="$(echo "$val" | /usr/bin/sed -E 's/^[[:space:]]+//; s/[[:space:]]+/ /g')"
              echo "$key: $val"
              ;;
      esac
    done \
  || true
echo "=== FASTFETCH END ==="
