16 lines
269 B
Plaintext
16 lines
269 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
cpu() {
|
||
|
bc<<<"scale=3;$(ps aux | awk 'BEGIN {sum=0} {sum+=$3}; END {print sum}') / $(nproc --all)"
|
||
|
}
|
||
|
|
||
|
ram() {
|
||
|
free -h | sed '2!d' | (read _ _ used _; echo $used)
|
||
|
}
|
||
|
|
||
|
bat() {
|
||
|
acpi -b | sed 's/Battery /BAT/'
|
||
|
}
|
||
|
|
||
|
echo "$(cpu)% $(ram) $(bat)"
|