commit 61551e4b945048792d05772223c0ac23e276dd32 from: anoncvs date: Sun May 17 17:42:25 2020 UTC New info for my new laptop, plus some nice colours commit - 50f4ade9acdc1d47cf3a692a00265853e15d7869 commit + 61551e4b945048792d05772223c0ac23e276dd32 blob - 020dcb267955d2cffe307684454636b03b95d8ae blob + 2d518ba628b53b589207ff9954d9924bd36f7eb3 --- termbar +++ termbar @@ -1,15 +1,27 @@ #!/bin/sh +## colours +ora='\e[0;35m' +rst='\033[0m' + while true; do - CPU_SPEED=$(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1) - CPU_TEMP=$(sysctl hw.sensors.cpu0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1) - RAM=$(top | grep Memory | awk {'print $3'}) - BAT_STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | cut -d "=" -f 2 | cut -d "." -f 1) - BAT=$(apm -l) - DATE=$(date) - NWID=$(ifconfig | grep ieee | awk {'print $3'}) - IP=$(dig +short myip.opendns.com @resolver1.opendns.com) - echo -en " $USER | $DATE | CPU: $CPU_SPEED - $CPU_TEMPĀ° | Ram: $RAM | Bat: $BAT - \ - $BAT_STATUS | Nwid: $NWID | Public IP: $IP\r" - sleep 1 + ## cpu + CPU_SPEED=$(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1) + CPU_TEMP=$(sysctl hw.sensors.cpu0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1) + ## ram + RAM=$(top | grep Memory | awk {'print $6'}) + ## battery + BAT_STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | cut -d "=" -f 2 | cut -d "." -f 1) + BAT=$(apm -l) + ## day + DATE=$(date +"%B %d - %H:%M") + ## wireless + SSID=$(ifconfig | grep ieee | awk -F'"' '$0=$2') + ## public ip + IP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'}) + ## printf all the things + printf " $DATE ${ora}|${rst} CPU: $CPU_SPEED ($CPU_TEMPĀ°) ${ora}|${rst} Free Ram: $RAM " + printf "${ora}|${rst} Bat: $BAT - $BAT_STATUS ${ora}|${rst} SSID: $SSID ${ora}|${rst}" + printf " Public IP: $IP \r" + sleep 1 done