From 7b8f3a767c60872683df07e5c9ec2c8845fa82f6 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 30 Apr 2018 21:15:00 +0000 Subject: [PATCH] .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. --- src/.bashrc.d/01detect_system | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.26.2