From 631ae8d2b475debf8b69de4100fdf27a18a0fd1a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 27 Mar 2017 09:50:52 +1100 Subject: [PATCH] GPU: [Linux] Hide duplicate lines --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index a3690aa9..8c6bf261 100755 --- a/neofetch +++ b/neofetch @@ -637,13 +637,13 @@ get_wm() { case "$os" in "Mac OS X") ps_line="$(ps -e | grep -o '[S]pectacle\|[A]methyst\|[k]wm')" - + case "$ps_line" in *"kwm"*) wm="Kwm" ;; *"Amethyst"*) wm="Amethyst" ;; *"Spectacle"*) wm="Spectacle" ;; *) wm="Quartz Compositor" ;; - esac + esac ;; "Windows") @@ -1064,7 +1064,7 @@ get_gpu() { "Linux") # Read GPUs into array. IFS=$'\n' - gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '/"Display|"3D|"VGA/ {print $3 " " $4}')) + gpus=($(lspci -mm | awk -F '\\"|\\" \\"' '!a[$0]++ && /"Display|"3D|"VGA/ {print $3 " " $4}')) IFS="$old_ifs" # Number the GPUs if more than one exists.