diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-02-29 23:48:20 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-02-29 23:48:20 +0200 |
| commit | d4b061378baee3355eb49927429efe466e915ff0 (patch) | |
| tree | f6abf9a36aff3594a4ed42ffc36abd1406520610 /.config | |
| parent | b9b65ab3afc036703283635f66336fc72a877f36 (diff) | |
| download | dotfiles-d4b061378baee3355eb49927429efe466e915ff0.tar.gz dotfiles-d4b061378baee3355eb49927429efe466e915ff0.zip | |
Add temperature.sh polybar script
Diffstat (limited to '.config')
| -rwxr-xr-x | .config/polybar/scripts/temperature.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/.config/polybar/scripts/temperature.sh b/.config/polybar/scripts/temperature.sh new file mode 100755 index 0000000..10c8ddc --- /dev/null +++ b/.config/polybar/scripts/temperature.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Pulls CPU temps, averages them, and outputs them + +let count=0 +sum=0.0 +for temp in $(sensors | grep "^Core" | grep -e '+.*C' | cut -f 2 -d '+' | cut -f 1 -d ' ' | sed 's/°C//'); do + sum=$(echo $sum+$temp | bc) + let count+=1 +done +avg=$(qalc -t $sum/$count) +echo "${avg}°C" |
