mirror of
https://github.com/Qubes-Community/Contents.git
synced 2024-10-01 01:05:51 -04:00
a002fca75b
A ressource monitor which can be run in dom0 and uses low system ressources
28 lines
720 B
Bash
28 lines
720 B
Bash
#!/bin/sh
|
|
# Author: tasket
|
|
# Github: https://github.com/tasket/
|
|
# Usage : A ressource monitor which can be run in dom0 and uses low system ressources (compared to Qubes Manager)
|
|
#
|
|
# Link to the repository of the initial author (tasket):
|
|
# https://github.com/tasket/Qubes-scripts/blob/master/system-stats-xen
|
|
|
|
delay=5
|
|
sensor_lines='Package id 0|fan1'
|
|
|
|
lnparse () {
|
|
if [ "$2" = 'CPU(%)' ]; then
|
|
clear
|
|
sensors |grep -E "^($sensor_lines)"
|
|
echo -e "\nVM NAME CPU(% ) MEMORY(MB)"
|
|
else
|
|
echo "$ln"
|
|
fi
|
|
}
|
|
|
|
clear
|
|
stdbuf -oL xentop -b -f -d $delay \
|
|
| stdbuf -oL awk '{sub(/\.[0-9]/, " ")} {printf ("%-20s %5s %7\047d\n", $1,$4,$5/1000) }' \
|
|
| while read ln; do
|
|
lnparse $ln
|
|
done
|