bin/quickinfo

40 lines
1001 B
Plaintext
Raw Permalink Normal View History

2025-01-22 12:28:58 -06:00
#!/usr/bin/env bash
if ! command -v gum >/dev/null; then
echo "Gum command not found"
exit 0
fi
function gumstyle() {
GUMSTYLE=$(gum style --foreground="#cba6f7" "$1")
echo "${GUMSTYLE} : ${2}"
}
echo
source /etc/os-release
gum style --foreground="#f38ba8" "$(echo $PRETTY_NAME)"
echo
gumstyle "Kernel" "$(uname -sr)"
gumstyle "Uptime" "$(uptime -p)"
echo
if [[ -f /etc/debian_version ]]; then
APT_PACKAGES=$(sudo apt update 2>/dev/null | grep packages | cut -d '.' -f 1 | awk '{print $1}')
gumstyle "APT updates" "$APT_PACKAGES"
fi
if [[ -f /etc/redhat-release ]]; then
DNF_PACKAGES=$(sudo dnf check-update | wc -l)
gumstyle "DNF updates" "$DNF_PACKAGES"
fi
if command -v flatpak >/dev/null; then
FLATPAK_PACKAGES=$(flatpak remote-ls --updates | wc -l)
gumstyle "Flatpak updates" "$FLATPAK_PACKAGES"
fi
if [[ -d /home/linuxbrew/.linuxbrew ]]; then
BREW_PACKAGES=$(cat /home/jas/.homebrew_updates)
gumstyle "Homebrew updates" "$BREW_PACKAGES"
fi