aboutsummaryrefslogtreecommitdiff
path: root/nofetch
diff options
context:
space:
mode:
Diffstat (limited to 'nofetch')
-rwxr-xr-xnofetch10
1 files changed, 7 insertions, 3 deletions
diff --git a/nofetch b/nofetch
index b67d150..3d85eb2 100755
--- a/nofetch
+++ b/nofetch
@@ -12,10 +12,14 @@ else
fi
fi
-
-if [ -d /Library ]
+uname -o &> /dev/null
+if [ $? -eq 0 ]
+then
+ osname=$(uname -o)
+fi
+if [ $(uname -s) == "Darwin" ]
then
- osname="macOS"
+ 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')