summaryrefslogtreecommitdiff
path: root/.wmii/rbar_cpu
blob: d3bdd88c5897d4039aa54884f6b4f8b89ece6c37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
. "$HOME/.wmii/include.sh"

priority=$1

while connected_to_x_server; do
	# This doesn't work for me, it shows capacity
	#echo -n 'Core MHz:' $(cat /proc/cpuinfo | grep 'cpu MHz' | sed 's/.*: //g; s/\..*//g;') |a "$WMII_DIR/rbar/${priority}_cpu"
	# This actually displays %idle
	echo 'CPU: [ '$(tail -n3 ~/tmp/cputime|sed -ur 's/\s\s+/\t/g'|cut -f2,11|sed 's/\t\(.*\)/(\1)/')' ]' |a "$WMII_DIR/rbar/${priority}_cpu"
	sleep 1
done