Skip to content

Commit

Permalink
revert 0f516ae
Browse files Browse the repository at this point in the history
close #413 #399
  • Loading branch information
darealshinji committed Nov 13, 2016
1 parent 3cdcc26 commit a4be668
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions screenfetch-dev
Original file line number Diff line number Diff line change
Expand Up @@ -1261,14 +1261,14 @@ detectgpu () {
else
if [[ -n "$(PATH="/opt/bin:$PATH" type -p nvidia-smi)" ]]; then
gpu=$($(PATH="/opt/bin:$PATH" type -p nvidia-smi | cut -f1) -q | awk -F':' '/Product Name/ {gsub(/: /,":"); print $2}' | sed ':a;N;$!ba;s/\n/, /g')
elif [[ -n "$(PATH="/usr/sbin:$PATH" type -p lspci)" && -z "$gpu" ]]; then
gpu_info=$($(PATH="/usr/bin:$PATH" type -p lspci | cut -f1) 2> /dev/null | grep VGA)
gpu=$(grep -oE '\[.*\]' <<< "${gpu_info}" | sed 's/\[//;s/\]//' | sed -n '1h;2,$H;${g;s/\n/, /g;p}')
elif [[ -n "$(PATH="/usr/sbin:$PATH" type -p glxinfo)" && -z "${gpu}" ]]; then
gpu_info=$($(PATH="/usr/sbin:$PATH" type -p glxinfo | cut -f1) 2>/dev/null)
gpu=$(grep "OpenGL renderer string" <<< "${gpu_info}" | cut -d ':' -f2 | sed -n '1h;2,$H;${g;s/\n/,/g;p}')
gpu="${gpu:1}"
gpu_info=$(grep "OpenGL vendor string" <<< "${gpu_info}")
elif [[ -n "$(PATH="/usr/sbin:$PATH" type -p lspci)" && -z "$gpu" ]]; then
gpu_info=$($(PATH="/usr/bin:$PATH" type -p lspci | cut -f1) 2> /dev/null | grep VGA)
gpu=$(grep -oE '\[.*\]' <<< "${gpu_info}" | sed 's/\[//;s/\]//' | sed -n '1h;2,$H;${g;s/\n/, /g;p}')
fi
fi

Expand Down

0 comments on commit a4be668

Please sign in to comment.