aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjnats <jnats@salyut.one>2021-05-19 13:05:56 +0100
committerGitHub <noreply@github.com>2021-05-19 13:05:56 +0100
commitf055c114d9618b12b5b09d110f820fcf5b5a3f6f (patch)
tree46137af8bfa38d49dac74bd6d76520941b7b01bd
parent9b95245de6c2c65c350db3cc43879d88498b1959 (diff)
downloadnofetch-f055c114d9618b12b5b09d110f820fcf5b5a3f6f.tar.gz
nofetch-f055c114d9618b12b5b09d110f820fcf5b5a3f6f.tar.bz2
fixed osname priority issue
-rwxr-xr-xnofetch9
1 files changed, 5 insertions, 4 deletions
diff --git a/nofetch b/nofetch
index 8ffc6d1..42651a1 100755
--- a/nofetch
+++ b/nofetch
@@ -13,15 +13,16 @@ else
fi
uname -o &> /dev/null
-if [ $? -eq 0 ]
-then
- osname=$(uname -o)
-elif [ $(uname -s) == "Darwin" ]
+
+if [ $(uname -s) == "Darwin" ]
then
osname=$(sw_vers | cut -d':' -f2- | head -n 1 | xargs)
elif [ -f /etc/os-release ]
then
osname=$(cat /etc/os-release | grep -w NAME | head -1 | sed 's/NAME=//g' | sed 's/\"//g' | sed 's/ Linux//g')
+elif [ $? -eq 0 ]
+then
+ osname=$(uname -o)
else
osname="Unknown"
fi