2022-01-23 10:37:44 -05:00
|
|
|
#!/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"
|
2022-01-27 13:23:27 -05:00
|
|
|
elif [[ -x /usr/bin/efibootmgr ]] && [ -d /boot/efi ]; then
|
2022-01-23 10:37:44 -05:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2022-01-27 13:23:27 -05:00
|
|
|
detect_snapshots() {
|
|
|
|
if [ -d /.snapshots ] || pacman -Qq snapper-support &> /dev/null; then
|
|
|
|
SNAPSHOTS="Snapper"
|
|
|
|
elif [ -d /run/timeshift ] || pacman -Qq timeshift-support &> /dev/null; then
|
|
|
|
SNAPSHOTS="Timeshift"
|
|
|
|
elif pacman -Qq snapper &> /dev/null; then
|
|
|
|
SNAPSHOTS="Snapper (maybe)"
|
|
|
|
elif pacman -Qq timeshift &> /dev/null; then
|
|
|
|
SNAPSHOTS="Timeshift (maybe)"
|
|
|
|
else
|
|
|
|
SNAPSHOTS="None/Undetected"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2022-01-30 13:47:35 -05:00
|
|
|
generate_relevant_software() {
|
|
|
|
local RELEVANT=()
|
|
|
|
systemctl is-enabled tlp &> /dev/null && RELEVANT+=("tlp")
|
|
|
|
systemctl is-active NetworkManager &> /dev/null && RELEVANT+=("NetworkManager")
|
|
|
|
systemctl is-active connman &> /dev/null && RELEVANT+=("connman")
|
|
|
|
RELEVANT_SOFTWARE="${RELEVANT[*]}"
|
|
|
|
[ -z "$RELEVANT_SOFTWARE" ] && RELEVANT_SOFTWARE="None"
|
|
|
|
}
|
|
|
|
|
2022-01-23 10:58:16 -05:00
|
|
|
[ -t 0 ] && inxi -Faz || inxi -Fazc0
|
2022-01-30 13:47:35 -05:00
|
|
|
echo -e "\033[1;34mGaruda ($(pacman -Q garuda-common-settings | awk '{print $2}')):\033[0m"
|
2022-01-23 10:37:44 -05:00
|
|
|
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)"
|
2022-01-30 13:47:35 -05:00
|
|
|
generate_relevant_software
|
|
|
|
echo -e "\033[1;34m Relevant software: \033[0m ${RELEVANT_SOFTWARE}"
|
2022-01-27 13:23:27 -05:00
|
|
|
detect_dual_boot &> /dev/null
|
2022-01-23 10:37:44 -05:00
|
|
|
echo -e "\033[1;34m Windows dual boot: \033[0m ${DUALBOOT}"
|
2022-01-27 13:23:27 -05:00
|
|
|
detect_snapshots
|
|
|
|
echo -e "\033[1;34m Snapshots: \033[0m ${SNAPSHOTS}"
|
2022-01-30 13:47:35 -05:00
|
|
|
echo -e "\033[1;34m Failed units: \033[0m $(systemctl list-units --failed --full --all --plain --no-legend | awk '{printf("%s ",$1)}')"
|