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

Annotation of dotfiles/termbar/termbar, Revision 1.1

1.1     ! gonzalo     1: #!/bin/sh
        !             2:
        !             3: ## colours
        !             4: ora='\e[0;35m'
        !             5: rst='\033[0m'
        !             6:
        !             7: while true; do
        !             8:        ## cpu
        !             9:        CPU_SPEED=$(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1)
        !            10:        CPU_TEMP=$(sysctl hw.sensors.cpu0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1)
        !            11:        ## ram
        !            12:        RAM=$(top | grep Memory | awk {'print $6'})
        !            13:        ## battery
        !            14:        BAT_STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | cut -d "=" -f 2 | cut -d "." -f 1)
        !            15:        BAT=$(apm -l)
        !            16:        ## day
        !            17:        DATE=$(date +"%B %d - %H:%M")
        !            18:        ## wireless
        !            19:        SSID=$(ifconfig | grep ieee | awk -F'"' '$0=$2')
        !            20:        ## public ip
        !            21:        IP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'})
        !            22:        ## printf all the things
        !            23:        printf "  $DATE ${ora}|${rst} CPU: $CPU_SPEED ($CPU_TEMPĀ°) ${ora}|${rst} Free Ram: $RAM "
        !            24:        printf "${ora}|${rst} Bat: $BAT - $BAT_STATUS ${ora}|${rst} SSID: $SSID ${ora}|${rst}"
        !            25:        printf " Public IP: $IP \r"
        !            26:        sleep 1
        !            27: done

CVSweb
CodeBerg
SourceHut