From b366211d700ff232b19a455a785e6179dd1cdf71 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Fri, 20 Jan 2023 19:54:21 -0500 Subject: [PATCH] [+] Linux bios detection https://github.com/dylanaraps/neofetch/issues/2284 --- neofetch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/neofetch b/neofetch index a025b4d1..beb7b137 100755 --- a/neofetch +++ b/neofetch @@ -76,6 +76,7 @@ print_info() { info "GPU" gpu info "Memory" memory info "Network" network + info "BIOS" bios # info "GPU Driver" gpu_driver # Linux/macOS only # info "Disk" disk @@ -1384,6 +1385,27 @@ get_distro() { ascii_distro=$(trim "$distro") } +get_bios() { + DMI="/sys/devices/virtual/dmi/id" + + # TODO: Add more platform support for bios detection + case $os in + Linux) + if [[ -f "$DMI/bios_vendor" ]]; then + bios="$(< $DMI/bios_vendor)" + + if [[ -f "$DMI/bios_release" ]]; then + bios+=" $(< $DMI/bios_release)" + fi + + if [[ -f "$DMI/bios_date" ]]; then + bios+=" $(< $DMI/bios_date)" + fi + fi + ;; + esac +} + get_model() { case $os in Linux) @@ -6332,6 +6354,7 @@ get_args() { info "GPU Driver" gpu_driver info "Memory" memory info "Network" network + info "BIOS" bios info "Disk" disk info "Battery" battery