1
0
Fork 0
mirror of https://github.com/Horhik/dotfiles.git synced 2024-11-27 02:21:32 +00:00
Dotfiles/.config/polybar/polybar-scripts/system-cpu-frequency/system-cpu-frequency.sh
2020-07-27 07:59:00 +03:00

11 lines
194 B
Bash

#!/bin/sh
c=0;t=0
awk '/MHz/ {print $4}' < /proc/cpuinfo | (while read -r i
do
t=$( echo "$t + $i" | bc )
c=$((c+1))
done
echo "scale=2; $t / $c / 1000" | bc | awk '{print $1" GHz"}')