[+] Linux bios detection

https://github.com/dylanaraps/neofetch/issues/2284
This commit is contained in:
Azalea Gui 2023-01-20 19:54:21 -05:00
parent e8f8968e4a
commit b366211d70
No known key found for this signature in database
GPG key ID: E289FAC0DA92DD2B

View file

@ -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