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
b36528dd
Commit
b36528dd
authored
Dec 02, 2016
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GPU: Add caching support for all OS
parent
7749be41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
39 deletions
+34
-39
neofetch
neofetch
+34
-39
No files found.
neofetch
View file @
b36528dd
...
@@ -919,53 +919,46 @@ get_cpu_usage() {
...
@@ -919,53 +919,46 @@ get_cpu_usage() {
}
}
get_gpu
()
{
get_gpu
()
{
# Use cache if it exists
if
[[
-
f
"
${
cache_dir
}
/neofetch/gpu"
]]
;
then
source
"
${
cache_dir
}
/neofetch/gpu"
return
fi
case
"
$os
"
in
case
"
$os
"
in
"Linux"
|
"GNU"
)
"Linux"
|
"GNU"
)
# Use cache if it exists
gpu
=
"
$(
PATH
=
"/sbin:
$PATH
"
lspci
-mm
|
awk
-F
'\\"|\\" \\"'
'/Display|3D|VGA/ {print $3 " " $4}'
)
"
if
[[
-f
"/tmp/neofetch/gpu"
]]
;
then
source
"/tmp/neofetch/gpu"
case
"
$gpu
"
in
else
*
"advanced"
*
)
gpu
=
"
$(
PATH
=
"/sbin:
$PATH
"
lspci
-mm
|
awk
-F
'\\"|\\" \\"'
'/Display|3D|VGA/ {print $3 " " $4}'
)
"
gpu
=
"
${
gpu
//Intel*
$'
\n
'
}
"
gpu
=
"
${
gpu
/
'[AMD/ATI]'
}
"
case
"
$gpu
"
in
gpu
=
"
${
gpu
/
'[AMD]'
}
"
*
"advanced"
*
)
gpu
=
"
${
gpu
/*\[
}
"
gpu
=
"
${
gpu
//Intel*
$'
\n
'
}
"
gpu
=
"
${
gpu
/\]*
}
"
gpu
=
"
${
gpu
/
'[AMD/ATI]'
}
"
gpu
=
"AMD
$gpu
"
gpu
=
"
${
gpu
/
'[AMD]'
}
"
;;
gpu
=
"
${
gpu
/*\[
}
"
gpu
=
"
${
gpu
/\]*
}
"
gpu
=
"AMD
$gpu
"
;;
*
"nvidia"
*
)
gpu
=
"
${
gpu
//Intel*
$'
\n
'
}
"
gpu
=
"
${
gpu
/*\[
}
"
gpu
=
"
${
gpu
/\]*
}
"
gpu
=
"NVIDIA
$gpu
"
;;
*
"virtualbox"
*
)
*
"nvidia"
*
)
gpu
=
"VirtualBox Graphics Adapter"
gpu
=
"
${
gpu
//Intel*
$'
\n
'
}
"
;;
gpu
=
"
${
gpu
/*\[
}
"
esac
gpu
=
"
${
gpu
/\]*
}
"
gpu
=
"NVIDIA
$gpu
"
;;
[[
"
$gpu
"
=
~
"intel"
]]
&&
\
*
"virtualbox"
*
)
gpu
=
"Intel Integrated Graphics"
gpu
=
"VirtualBox Graphics Adapter"
;;
esac
cache
"gpu"
"
$gpu
"
[[
"
$gpu
"
=
~
"intel"
]]
&&
\
fi
gpu
=
"Intel Integrated Graphics"
;;
;;
"Mac OS X"
)
"Mac OS X"
)
# Use cache if it exists
gpu
=
"
$(
system_profiler SPDisplaysDataType |
awk
-F
': '
'/^\ *Chipset Model:/ {printf $2 ", "}'
)
"
if
[[
-f
"
${
cache_dir
}
/neofetch/gpu"
]]
;
then
gpu
=
"
${
gpu
//
'/ $'
}
"
source
"
${
cache_dir
}
/neofetch/gpu"
gpu
=
"
${
gpu
%,*
}
"
else
gpu
=
"
$(
system_profiler SPDisplaysDataType |
awk
-F
': '
'/^\ *Chipset Model:/ {printf $2 ", "}'
)
"
gpu
=
"
${
gpu
//
'/ $'
}
"
gpu
=
"
${
gpu
%,*
}
"
cache
"gpu"
"
$gpu
"
fi
;;
;;
"iPhone OS"
)
"iPhone OS"
)
...
@@ -1030,6 +1023,8 @@ get_gpu() {
...
@@ -1030,6 +1023,8 @@ get_gpu() {
gpu
=
"
${
gpu
/NVIDIA
}
"
gpu
=
"
${
gpu
/NVIDIA
}
"
gpu
=
"
${
gpu
/Intel
}
"
gpu
=
"
${
gpu
/Intel
}
"
fi
fi
cache
"gpu"
"
$gpu
"
}
}
get_memory
()
{
get_memory
()
{
...
...
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