From ec0ed23d112ac9a76eaa8647a61f34107b51a7b6 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 29 Oct 2016 16:02:24 +1100 Subject: [PATCH] Term: Add a fallback to ps. --- neofetch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 576bba5a..06ebaa3a 100755 --- a/neofetch +++ b/neofetch @@ -1452,10 +1452,15 @@ getterm() { name="${name/*\/}" ;; - *) + "Linux") parent="$(grep -F "PPid:" "/proc/${1:-$PPID}/status")" name="$(< "/proc/${parent/PPid:[[:space:]]}/comm")" ;; + + *) + parent="$(ps -p ${1:-$PPID} -o ppid=)" + name="$(ps -p $parent -o comm=)" + ;; esac case "${name// }" in