dotfiles/termscripts/refresh-cpu-usage.sh

6 lines
134 B
Bash

#!/usr/bin/env sh
ret="$(top -bn 2 -d 5 | grep '^%Cpu' | tail -n 1 | gawk '{print $2+$4+$6}')"
printf "%b\n" "$ret" > /tmp/cpu-freq