From c0cfcb3b36e2f265054d30977214c0aff318e070 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 12 Jun 2019 20:50:04 +0300 Subject: [PATCH] term: Fix wrapper scripts in NixOS. Thanks Tdeo. --- neofetch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index f888a745..6efa8bff 100755 --- a/neofetch +++ b/neofetch @@ -2884,12 +2884,15 @@ get_term() { *"NeoVimServer"*) term="VimR Terminal" ;; *) + # Fix issues with long process names on Linux. + [[ $os == Linux ]] && term=$(realpath "/proc/$parent/exe") + term="${name##*/}" # Fix wrapper names in NixOS. - [[ "$distro" == NixOS* && $term == .*-* ]] && { + [[ $term == .*-wrapped ]] && { term="${term#.}" - term="${term%-*}" + term="${term%-wrapped}" } ;; esac