#!/bin/bash

read cpu a b c previdle rest < /proc/stat
prevtotal=$((a+b+c+previdle))
sleep 1.5
read cpu a b c idle rest < /proc/stat
total=$((a+b+c+idle))
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
mem=`free | awk '/Mem/ {printf "%d MB\n", $3 / 1024.0, $2 / 1024.0 }'`
disk=$(df / |cut -d' ' -f12 |tail -1)
#UnComment to show CPU icon (and if doing so, comment the "echo" line:
#Please note an "echo" line here allows to be displayed, next to it, more than one line, piled horizontally
#echo /usr/share/icons/papirus-antix/24x24/panel/indicator-sensors-cpu.png
 echo
#UnComment to show CPU usage (in percetage):
 echo "CPU $cpu%"
#UnComment to show available RAM:
echo "RAM $mem"
#UnComment to show available disk space in home:
# echo " /     $disk"
