Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add Ubuntu version shortname in output by default #2110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -1008,14 +1008,6 @@ get_distro() {
distro="Proxmox VE ${distro%/*}"
esac

elif type -p lsb_release >/dev/null; then
case $distro_shorthand in
on) lsb_flags=-si ;;
tiny) lsb_flags=-si ;;
*) lsb_flags=-sd ;;
esac
distro=$(lsb_release "$lsb_flags")

elif [[ -f /etc/os-release || \
-f /usr/lib/os-release || \
-f /etc/openwrt_release || \
Expand All @@ -1024,15 +1016,25 @@ get_distro() {
# Source the os-release file
for file in /etc/lsb-release /usr/lib/os-release \
/etc/os-release /etc/openwrt_release; do
source "$file" && break
source "$file"
done

# Format the distro name.
case $distro_shorthand in
on) distro="${NAME:-${DISTRIB_ID}} ${VERSION_ID:-${DISTRIB_RELEASE}}" ;;
tiny) distro="${NAME:-${DISTRIB_ID:-${TAILS_PRODUCT_NAME}}}" ;;
off) distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} ${UBUNTU_CODENAME}" ;;
off) distro="${PRETTY_NAME:-${DISTRIB_DESCRIPTION}} (${UBUNTU_CODENAME})" ;;
esac

elif type -p lsb_release >/dev/null; then
case $distro_shorthand in
on) lsb_flags=-si ;;
tiny) lsb_flags=-si ;;
*) lsb_flags=-sd ;;
esac
distro=$(lsb_release "$lsb_flags")



elif [[ -f /etc/GoboLinuxVersion ]]; then
case $distro_shorthand in
Expand Down