mirror of
https://gitlab.com/mattia.basaglia/ASCII-Pony.git
synced 2024-11-21 19:57:59 +01:00
Add CPU Usage info
This commit is contained in:
parent
7b4325a89b
commit
e10ea10782
2 changed files with 5 additions and 0 deletions
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 50 KiB |
|
@ -81,6 +81,11 @@ function ponyget_CPU()
|
|||
cat /proc/cpuinfo | grep "model name" | head -n 1 | sed -r "s/model name\s: //"
|
||||
}
|
||||
|
||||
function ponyget_CPU_Usage()
|
||||
{
|
||||
echo "$(top -b -n1 | grep "Cpu(s):" | sed -r -e "s/^[^0-9]+//" -e "s/[^0-9]+,\s+/ + /g" -e "s/[^0-9]+$//" | cut -d ' ' -f 1-5 | bc)%"
|
||||
}
|
||||
|
||||
function ponyget_Uptime()
|
||||
{
|
||||
uptime | grep -oE "up.*user" | \
|
||||
|
|
Loading…
Reference in a new issue