- #!/bin/sh
- ram=$(top -b -n 1 | grep "MiB Mem" | awk '{print $6}')
- disk_root=$(df -h / 2>/dev/null | grep " /" | awk '{print $4}')
- disk_home=$(df -h /home 2>/dev/null | grep " /home" | awk '{print $4}')
- cpu_temp=$(sensors | grep "Package id 0:" | awk '{print $4}')
- if [ -z "$cpu_temp" ]; then
- cpu_temp=$(sensors | grep "Tctl:" | awk '{print $2}')
- fi
- batt=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'percentage' | awk '{print $2}')
- date=$(date '+%Y-%m-%d %H:%M')
- echo "T:$cpu_temp /:$disk_root /home:$disk_home R:$ram B:$batt | $date"
|