gpu [linux]: Add clock speed
This commit is contained in:
parent
f2300d3306
commit
8e29cd00b3
1 changed files with 7 additions and 1 deletions
8
neofetch
8
neofetch
|
@ -1212,7 +1212,7 @@ get_gpu() {
|
||||||
# Read GPUs into array.
|
# Read GPUs into array.
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
|
gpus=($(lspci -mm | awk -F '\\"|\\" \\"|\\(' \
|
||||||
'/"Display|"3D|"VGA/ {a[$0] = $3 " " $4} END{for(i in a)
|
'/"Display|"3D|"VGA/ {a[$0] = $1 $3 " " $4} END{for(i in a)
|
||||||
{if(!seen[a[i]]++) print a[i]}}'))
|
{if(!seen[a[i]]++) print a[i]}}'))
|
||||||
IFS="$old_ifs"
|
IFS="$old_ifs"
|
||||||
|
|
||||||
|
@ -1225,6 +1225,8 @@ get_gpu() {
|
||||||
[[ "$gpu_type" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \
|
[[ "$gpu_type" == "integrated" && ! "$gpu" =~ (i|I)ntel ]] && \
|
||||||
{ unset -v gpu; continue; }
|
{ unset -v gpu; continue; }
|
||||||
|
|
||||||
|
freq="$(< /sys/devices/pci0000\:00/0000\:"${gpu/ *}"/drm/card0/gt_cur_freq_mhz)"
|
||||||
|
|
||||||
case "$gpu" in
|
case "$gpu" in
|
||||||
*"advanced"*)
|
*"advanced"*)
|
||||||
gpu="${gpu/'[AMD/ATI]' }"
|
gpu="${gpu/'[AMD/ATI]' }"
|
||||||
|
@ -1267,6 +1269,10 @@ get_gpu() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu"
|
prin "${subtitle:+${subtitle}${gpu_name}}" "$gpu"
|
||||||
|
|
||||||
|
[[ "$gpu_freq" == "on" && "$freq" ]] && \
|
||||||
|
prin "GPU Frequency" "${freq}Mhz"
|
||||||
|
|
||||||
((++gpu_num))
|
((++gpu_num))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue