terminfo_short-ubuntu 782 B

1234567891011121314
  1. #!/bin/sh
  2. ram=$(top -b -n 1 | grep "MiB Mem" | awk '{print $6}')
  3. disk_root=$(df -h / 2>/dev/null | grep " /" | awk '{print $4}')
  4. disk_home=$(df -h /home 2>/dev/null | grep " /home" | awk '{print $4}')
  5. #cpu_temp=$(sensors | grep CPU: | awk '{print $2}')
  6. cpu_temp=$(sensors | grep "Package id 0:" | awk '{print $4}')
  7. batt=$(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'percentage' | awk '{print $2}')
  8. date=$(date '+%Y-%m-%d %H:%M')
  9. ip_address_public=$(curl --silent --connect-timeout 1 ifconfig.me)
  10. ip_address_private=$(hostname -I | awk '{print $1}')
  11. top_proc=$(top -b -n 1 | grep $(whoami) | awk '{print $9"|"$12}' | head -n 1)
  12. echo "ip:$ip_address_public ip:$ip_address_private degC:$cpu_temp /:$disk_root /home:$disk_home top:$top_proc R:$ram B:$batt | $date"