98 lines
2.7 KiB
Bash
Executable file
98 lines
2.7 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
|
|
# COLORS
|
|
CLEAR="\e[0m"
|
|
RED="\e[31m"
|
|
GREEN="\e[32m"
|
|
YELLOW="\e[33m"
|
|
BLUE="\e[34m"
|
|
|
|
function print_in_columns() {
|
|
string="$1"
|
|
label="$(echo "$string" | sed -r 's/^\s*(.*:).*/\1/')"
|
|
value="$(echo "$string" | sed -r 's/^\s*.*:\s*(.*)/\1/')"
|
|
printf ' %-18s%s\n' "$label" "$value"
|
|
}
|
|
|
|
# System
|
|
echo -e "${BLUE}System Information${CLEAR}"
|
|
echo " Vendor: $(cat /sys/devices/virtual/dmi/id/sys_vendor)"
|
|
echo " Name: $(cat /sys/devices/virtual/dmi/id/product_name)"
|
|
echo " Serial: $(cat /sys/devices/virtual/dmi/id/product_serial)"
|
|
echo ""
|
|
|
|
# Motherboard
|
|
echo -e "${BLUE}Motherboard${CLEAR}"
|
|
echo " Vendor: $(cat /sys/devices/virtual/dmi/id/board_vendor)"
|
|
echo " Name: $(cat /sys/devices/virtual/dmi/id/board_name)"
|
|
echo " Version: $(cat /sys/devices/virtual/dmi/id/board_version)"
|
|
echo " Serial: $(cat /sys/devices/virtual/dmi/id/board_serial)"
|
|
echo ""
|
|
|
|
# BIOS
|
|
echo -e "${BLUE}BIOS${CLEAR}"
|
|
echo " Vendor: $(cat /sys/devices/virtual/dmi/id/bios_vendor)"
|
|
echo " Version: $(cat /sys/devices/virtual/dmi/id/bios_version)"
|
|
echo " Release Date: $(cat /sys/devices/virtual/dmi/id/bios_date)"
|
|
echo ""
|
|
|
|
# Processor
|
|
echo -e "${BLUE}Processor${CLEAR}"
|
|
lscpu | grep -E '^(Arch|CPU.s.|Core|Thread|Model name|Virt)' \
|
|
| sed -r 's/\(s\)(.*:)/s\1 /' \
|
|
| sed -r 's/CPUs: /Threads:/' \
|
|
| sed -r 's/^(.*:) / \1/'
|
|
echo ""
|
|
|
|
# Memory
|
|
echo -e "${BLUE}Memory${CLEAR}"
|
|
first_device="True"
|
|
while read -r line; do
|
|
if [[ "$line" == "Memory Device" ]]; then
|
|
if [[ "$first_device" == "True" ]]; then
|
|
first_device="False"
|
|
else
|
|
# Add space between devices
|
|
echo ""
|
|
fi
|
|
else
|
|
print_in_columns "$line"
|
|
fi
|
|
done <<< $(sudo dmidecode -t memory \
|
|
| grep -E '^(Memory Device|\s+(Type|Size|Speed|Manuf.*|Locator|Part Number):)')
|
|
echo ""
|
|
|
|
# Graphics
|
|
echo -e "${BLUE}Graphics${CLEAR}"
|
|
lspci | grep 'VGA' | sed -r 's/^.*:/ Device: /' \
|
|
| sed 's/Intel Corporation/Intel/' \
|
|
| sed 's/Generation Core Processor Family/Gen/' \
|
|
| sed 's/Integrated Graphics Controller.*/iGPU/'
|
|
glxinfo | grep 'OpenGL renderer' | sed -r 's/^.*:/ OpenGL Renderer: /' \
|
|
| sed 's/Mesa DRI //'
|
|
echo ""
|
|
|
|
# Audio
|
|
echo -e "${BLUE}Audio${CLEAR}"
|
|
while read -r line; do
|
|
print_in_columns "$line"
|
|
done <<< $(aplay -l | grep '^card' | sed -r 's/.*\[(.*)\].*\[(.*)\].*/\1: \2/')
|
|
echo ""
|
|
|
|
# Network
|
|
echo -e "${BLUE}Network${CLEAR}"
|
|
lspci | grep -Ei '(ethernet|network|wireless|wifi)' \
|
|
| sed -r 's/.*: (.*) \(.*$/ \1/'
|
|
echo ""
|
|
|
|
# Drives
|
|
echo -e "${BLUE}Drives${CLEAR}"
|
|
hw-drive-info | sed 's/^/ /'
|
|
echo ""
|
|
|
|
# Sensors
|
|
echo -e "${BLUE}Sensors${CLEAR}"
|
|
hw-sensors | sed 's/^/ /'
|
|
echo ""
|
|
|