diff --git a/.bin/Scripts/hw-drive-info b/.bin/Scripts/hw-drive-info new file mode 100755 index 00000000..71a8d388 --- /dev/null +++ b/.bin/Scripts/hw-drive-info @@ -0,0 +1,27 @@ +#!/bin/bash +# + +BLUE='\033[34m' +CLEAR='\033[0m' + +# List devices +IFS=$'\n' +for line in $(lsblk -do NAME,TRAN,SIZE,VENDOR,MODEL,SERIAL); do + if [[ "${line:0:4}" == "NAME" ]]; then + echo -e "${BLUE}${line}${CLEAR}" + else + echo "${line}" + fi +done +echo "" + +# List partitions +for line in $(lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT); do + if [[ "${line:0:4}" == "NAME" ]]; then + echo -e "${BLUE}${line}${CLEAR}" + else + echo "${line}" + fi +done +echo "" + diff --git a/.bin/Scripts/hw-info b/.bin/Scripts/hw-info new file mode 100755 index 00000000..f4508fa9 --- /dev/null +++ b/.bin/Scripts/hw-info @@ -0,0 +1,98 @@ +#!/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 "" + diff --git a/.linux_items/include/airootfs/etc/skel/.aliases b/.linux_items/include/airootfs/etc/skel/.aliases index 2fc314d1..d20b59b3 100644 --- a/.linux_items/include/airootfs/etc/skel/.aliases +++ b/.linux_items/include/airootfs/etc/skel/.aliases @@ -7,7 +7,8 @@ alias 7z9='7z a -t7z -mx=9' alias diff='colordiff -ur' alias du='du -sch --apparent-size' alias fix-perms='find -type d -exec chmod 755 "{}" \; && find -type f -exec chmod 644 "{}" \;' -alias hw-info='sudo inxi -ACDdGlMmNopRsxxc 25' +alias hw-info='sudo hw-info | less -S' +alias inxi='echo -e "\e[33mWARNING: inxi is being replaced and will be removed in a future WizardKit release\e[0m"; echo -e " \e[32mReplacements include:\e[0m 'hw-drive-info', 'hw-info', & 'hw-sensors'"; echo ""; inxi' alias less='less -S' alias ls='ls --color=auto' alias mkdir='mkdir -p'