Add garuda-inxi command
This commit is contained in:
parent
6a980152a6
commit
883261a610
2 changed files with 25 additions and 1 deletions
2
PKGBUILD
2
PKGBUILD
|
@ -2,7 +2,7 @@
|
|||
# Maintainer: Librewish <librewish@gmail.com>
|
||||
|
||||
pkgname=garuda-common-settings
|
||||
pkgver=2.4.6
|
||||
pkgver=2.5.0
|
||||
pkgrel=1
|
||||
arch=('any')
|
||||
url="https://gitlab.com/garuda-linux/themes-and-settings/settings/$pkgname"
|
||||
|
|
24
usr/bin/garuda-inxi
Executable file
24
usr/bin/garuda-inxi
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
detect_dual_boot() {
|
||||
if [[ $EUID -eq 0 ]] && [[ -x /usr/bin/os-prober ]]; then
|
||||
local OSPROBER_OUT="$(os-prober)" || { DUALBOOT="Os-prober error"; exit; }
|
||||
echo $OSPROBER_OUT | grep -q "Windows Boot Manager" &> /dev/null && DUALBOOT="Yes" || DUALBOOT="No/Undetected"
|
||||
elif [[ -x /usr/bin/efibootmgr ]]; then
|
||||
local EFIBOOTMGR_OUT="$(efibootmgr)" || { DUALBOOT="Efibootmgr error"; exit; }
|
||||
echo $EFIBOOTMGR_OUT | grep -q "Windows Boot Manager" &> /dev/null && DUALBOOT="Probably (Run as root to verify)" || DUALBOOT="No/Undetected"
|
||||
elif [[ -x /usr/bin/os-prober ]]; then
|
||||
DUALBOOT="<superuser required>"
|
||||
else
|
||||
DUALBOOT="No detection tool installed"
|
||||
fi
|
||||
}
|
||||
|
||||
inxi -Faz
|
||||
echo -e "\033[1;34mGaruda:\033[0m"
|
||||
echo -e "\033[1;34m System install date:\033[0m $(head -n1 /var/log/pacman.log | cut -d " " -f1 | cut -c 2-11)"
|
||||
echo -e "\033[1;34m Last full system update:\033[0m $(date -r /var/lib/garuda/last_update +%F 2> /dev/null || echo "Unknown/Never")"
|
||||
echo -e "\033[1;34m Is partially upgraded: \033[0m $([ -e /var/lib/garuda/partial_upgrade ] && echo Yes || echo No)"
|
||||
detect_dual_boot #&> /dev/null
|
||||
echo -e "\033[1;34m Using TLP: \033[0m $(systemctl is-enabled tlp &> /dev/null && echo Yes || echo No)"
|
||||
echo -e "\033[1;34m Windows dual boot: \033[0m ${DUALBOOT}"
|
Loading…
Reference in a new issue