terminfo_short-openbsd 875 B

123456789101112131415
  1. #!/bin/ksh
  2. ram=$(top -b -n 1 | grep "Memory: " | 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=$(sysctl hw.sensors | grep -e "cpu0.temp0" -e "acpithinkpad0.temp0" | cut -d"=" -f 2 | awk '{print $1}')
  6. audio_device=$(sndioctl server.device | awk -F= '{print $2}')
  7. audio_level=$(sndioctl output.level | awk -F= '{print $2}')
  8. batt=$(apm -l)
  9. date=$(date '+%Y-%m-%d %H:%M')
  10. ip_address_public=$(curl --silent --connect-timeout 1 ifconfig.me)
  11. ip_address_private=$(ifconfig -a | grep "inet 192.168." | awk '{print $2}' | head -1)
  12. top_proc=$(top -b -n 1 | grep $(whoami) | awk '{print $11"|"$10}')
  13. echo "ip:$ip_address_public ip:$ip_address_private ad:$audio_device al:$audio_level degC:$cpu_temp /:$disk_root /home:$disk_home top:$top_proc R:$ram B:$batt | $date"