mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-03-26 04:57:45 +01:00
statusbar: split cpu and gpu temps
This commit is contained in:
parent
751cc5fbfe
commit
485dbba39b
@ -1,16 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
gpu_temp=""
|
||||
|
||||
if command -v nvidia-smi > /dev/null; then
|
||||
gpu_temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)
|
||||
gpu_temp=$(printf %3s $(echo ${gpu_temp##*+} | sed "s/\..*//") | tr ' ' ' ')
|
||||
gpu_temp=" | $gpu_temp°C"
|
||||
fi
|
||||
|
||||
model=$(cat /proc/cpuinfo | grep "model name" | head -n1)
|
||||
|
||||
icon="^b#282828^^c#dfdfdf^ ^d^"
|
||||
icon="^b#282828^^c#dfdfdf^ ^d^"
|
||||
|
||||
if printf "$model " | grep -Fqe "AMD"; then
|
||||
temp=$(sensors | awk '/Tctl/ {print $2}')
|
||||
@ -20,4 +12,4 @@ fi
|
||||
|
||||
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
|
||||
|
||||
echo "$icon $temp°C$gpu_temp "
|
||||
echo "$icon $temp°C"
|
||||
|
12
.local/bin/tools/statusbar/gpu
Executable file
12
.local/bin/tools/statusbar/gpu
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
icon="^b#282828^^c#dfdfdf^ ^d^"
|
||||
|
||||
temp=""
|
||||
|
||||
if command -v nvidia-smi > /dev/null; then
|
||||
temp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)
|
||||
temp=$(printf %3s $(echo ${temp##*+} | sed "s/\..*//") | tr ' ' ' ')
|
||||
fi
|
||||
|
||||
echo "$icon $temp°C"
|
Loading…
x
Reference in New Issue
Block a user