coolguylentz

Advanced INXI sysinfo.sh for Eggdrop

Dec 12th, 2025
5,829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Bold + purple (06) for labels
  4. LABEL_COLOR=$'\002\00306' # ^B then ^C06
  5. RESET_COLOR=$'\017' # ^O
  6.  
  7. host=$(hostname)
  8. distro=$(awk -F= '$1=="PRETTY_NAME"{gsub(/"/,"",$2); print $2}' /etc/os-release)
  9.  
  10. {
  11. # First line: Host + Distro (no Kernel here)
  12. printf 'Host: %s Distro: %s\n' "$host" "$distro"
  13.  
  14. # Then your normal inxi summary
  15. inxi -c0 2>/dev/null
  16. } | awk -v L="$LABEL_COLOR" -v R="$RESET_COLOR" '
  17. {
  18. # Color only the labels, leave values plain
  19. for (i=1; i<=NF; i++) {
  20. if ($i ~ /^(Host:|Distro:|Kernel:|CPU:|Up:|Mem:|Storage:|Procs:|Shell:|Client:|inxi:)$/) {
  21. $i = L $i R
  22. }
  23. }
  24.  
  25. # Collapse everything into one line with trailing quote like your original
  26. if (NR > 1)
  27. out = out "\" " $0
  28. else
  29. out = $0
  30. }
  31. END {
  32. print out "\""
  33. }
  34. '
  35.  
Advertisement