[BACK]Return to termbar CVS log [TXT][DIR] Up to [x61] / dotfiles / termbar

Annotation of dotfiles/termbar/termbar, Revision 1.2

1.1       gonzalo     1: #!/bin/sh
                      2:
1.2     ! gonzalo     3: yel='\033[33m'
        !             4: pur='\033[35m'
        !             5: gre='\033[32m'
1.1       gonzalo     6: rst='\033[0m'
                      7:
1.2     ! gonzalo     8: pipe="${pur}|${rst}"
        !             9:
1.1       gonzalo    10: while true; do
                     11:        CPU_SPEED=$(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1)
                     12:        CPU_TEMP=$(sysctl hw.sensors.cpu0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1)
                     13:        RAM=$(top | grep Memory | awk {'print $6'})
                     14:        BAT_STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | cut -d "=" -f 2 | cut -d "." -f 1)
                     15:        BAT=$(apm -l)
                     16:        DATE=$(date +"%B %d - %H:%M")
                     17:        SSID=$(ifconfig | grep ieee | awk -F'"' '$0=$2')
1.2     ! gonzalo    18: #      SSID=$(ifconfig | grep ieee | awk '/join/ {print $3}')
        !            19:        INTIP=$(ifconfig trunk0 | grep inet | awk '{print $2}')
1.1       gonzalo    20:        IP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'})
1.2     ! gonzalo    21:        printf "  $DATE ${pipe} ${gre}CPU:${rst} $CPU_SPEED ($CPU_TEMPĀ°) ${pipe} ${gre}Free Ram:${rst} $RAM "
        !            22:        printf "${pipe} ${gre}Bat:${rst} $BAT - $BAT_STATUS ${pipe} ${gre}SSID:${rst} $SSID ${pipe}"
        !            23:        printf " ${gre}Pub. IP:${rst} $IP - ${gre}Int. IP:${rst} $INTIP \r"
        !            24:        sleep 15
1.1       gonzalo    25: done

CVSweb
CodeBerg
SourceHut