瀏覽代碼

term: Fix wrapper scripts in NixOS. Thanks Tdeo.

Dylan Araps 6 年之前
父節點
當前提交
c0cfcb3b36
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      neofetch

+ 5 - 2
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