Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
0177837f
Commit
0177837f
authored
Oct 26, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GPU: Start rewrite
parent
cc9095cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
49 deletions
+7
-49
neofetch
neofetch
+7
-49
No files found.
neofetch
View file @
0177837f
...
...
@@ -989,63 +989,25 @@ getgpu() {
"Linux"
)
gpu
=
"
$(
PATH
=
"/sbin:
$PATH
"
lspci
-mm
|
awk
-F
'\\"|\\" \\"'
'/3D|VGA/ {print $3 " " $4}'
)
"
# If a GPU with a prefix of '3D' doesn't exist
# fallback to looking for a prefix of 'VGA'
# [ -z "$gpu" ] && \
# gpu="$(PATH="/sbin:$PATH" lspci | grep -F "VGA")"
gpu
=
"
${
gpu
//??
':'
??
'.'
?
}
"
# Count the number of GPUs
count
=
"
$(
printf
"%s"
"
$gpu
"
|
uniq
-c
)
"
count
=
"
${
count
/ VGA*
}
"
count
=
"
${
count
/ 3D*
}
"
# If there's more than one gpu
# Display the count.
if
[
"
$count
"
-gt
1
]
;
then
count
=
" x
$count
"
else
unset
count
fi
# Format the output
gpu
=
"
${
gpu
/* VGA compatible controller
:
}
"
gpu
=
"
${
gpu
/* 3D controller
:
}
"
gpu
=
"
${
gpu
/(rev*)
}
"
gpu
=
"
${
gpu
/\[
}
"
gpu
=
"
${
gpu
/\]
}
"
case
"
$gpu
"
in
intel
*
)
gpu
=
"Intel Integrated Graphics"
;;
intel
*
)
gpu
=
"Intel Integrated Graphics"
;;
advanced
*
)
gpu
=
"
${
gpu
/Advanced Micro Devices, Inc\.
}
"
gpu
=
"
${
gpu
/
'[AMD/ATI]'
}
"
gpu
=
"
${
gpu
/Tahiti PRO
}
"
gpu
=
"
${
gpu
/XTX
}
"
gpu
=
"
${
gpu
/ OEM
}
"
gpu
=
"
${
gpu
/*Radeon/Radeon
}
"
brand
=
"AMD "
gpu
=
"
${
gpu
/
'[AMD]'
}
"
gpu
=
"
${
gpu
/*\[
}
"
gpu
=
"
${
gpu
/\]*
}
"
;;
nvidia
*
)
gpu
=
"
${
gpu
/NVIDIA Corporation
}
"
gpu
=
"
${
gpu
/G????M
}
"
gpu
=
"
${
gpu
/G????
}
"
brand
=
"NVIDIA "
gpu
=
"
${
gpu
/*\[
}
"
gpu
=
"
${
gpu
/\]*
}
"
;;
*
virtualbox
*
)
gpu
=
"VirtualBox Graphics Adapter"
;;
esac
gpu
=
"
${
brand
}${
gpu
}
"
;;
"Mac OS X"
)
...
...
@@ -1137,11 +1099,7 @@ getgpu() {
case "$gpu_shorthand" in
"on" | "tiny")
gpu="${gpu// Rev\. ?}"
gpu="${gpu//AMD*\/ATI\]/AMD}"
gpu="${gpu// Tahiti}"
gpu="${gpu// PRO}"
gpu="${gpu// OEM}"
gpu="${gpu// Mars}"
gpu="${gpu// Series}"
gpu="${gpu// Controller}"
gpu="${gpu/\/*}"
...
...
@@ -2427,7 +2385,7 @@ info() {
eval output="\$${1}"
else
time
"get$2" 2>/dev/null
"get$2" 2>/dev/null
eval output="\$${2}"
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment