From: W. Trevor King Date: Mon, 30 Apr 2018 21:15:00 +0000 (+0000) Subject: .bashrc.d/01detect_system: Use os-release to detect Arch X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7b8f3a767c60872683df07e5c9ec2c8845fa82f6;p=dotfiles-public.git .bashrc.d/01detect_system: Use os-release to detect Arch Example content: NAME="Arch Linux ARM" ID=archarm ID_LIKE=arch PRETTY_NAME="Arch Linux ARM" ANSI_COLOR="0;36" HOME_URL="http://archlinuxarm.org/" SUPPORT_URL="https://archlinuxarm.org/forum" BUG_REPORT_URL="https://github.com/archlinuxarm/PKGBUILDs/issues" I should probably update the others to use os-release too, but I'm putting that off for now. --- diff --git a/src/.bashrc.d/01detect_system b/src/.bashrc.d/01detect_system index 7030a1b..03d8f17 100644 --- a/src/.bashrc.d/01detect_system +++ b/src/.bashrc.d/01detect_system @@ -9,6 +9,8 @@ if [ -z "${OS}" ]; then export OS='Gentoo' elif [ "${SHELL#*gentoo}" != "${SHELL}" ]; then # assumes 'gentoo' in prefix export OS='Gentoo Prefix' + elif grep -i '^ID=.*arch' /etc/os-release > /dev/null 2>&1; then + export OS='Arch' elif grep -i debian /etc/issue > /dev/null 2>&1; then export OS='Debian' elif grep -i ubuntu /etc/issue > /dev/null 2>&1; then