11 lines
312 B
Bash
Executable File
11 lines
312 B
Bash
Executable File
#!/bin/bash
|
|
|
|
COLOR1="#990057"
|
|
COLOR2="#FF00B2"
|
|
|
|
load1="$(grep 'cpu ' /proc/stat)"
|
|
load2="$(sleep 1 && grep 'cpu ' /proc/stat)"
|
|
usage=$(echo "$load1 \n $load2" | awk -v RS="" '{print ($13-$2+$15-$4)*100/($13-$2+$15-$4+$16-$5)}' | cut -d'.' -f1)"%"
|
|
|
|
echo "^c$COLOR1^^b$COLOR2^ ^b$COLOR1^^c$COLOR2^ $usage ^d^"
|