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

Diff for /dotfiles/termbar/termbar between version 1.1 and 1.2

version 1.1, 2020/05/18 07:28:56 version 1.2, 2020/06/01 16:24:12
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
   
 ## colours  yel='\033[33m'
 ora='\e[0;35m'  pur='\033[35m'
   gre='\033[32m'
 rst='\033[0m'  rst='\033[0m'
   
   pipe="${pur}|${rst}"
   
 while true; do  while true; do
         ## cpu  
         CPU_SPEED=$(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1)          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)          CPU_TEMP=$(sysctl hw.sensors.cpu0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1)
         ## ram  
         RAM=$(top | grep Memory | awk {'print $6'})          RAM=$(top | grep Memory | awk {'print $6'})
         ## battery  
         BAT_STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | cut -d "=" -f 2 | cut -d "." -f 1)          BAT_STATUS=$(sysctl hw.sensors.acpiac0.indicator0 | cut -d "=" -f 2 | cut -d "." -f 1)
         BAT=$(apm -l)          BAT=$(apm -l)
         ## day  
         DATE=$(date +"%B %d - %H:%M")          DATE=$(date +"%B %d - %H:%M")
         ## wireless  
         SSID=$(ifconfig | grep ieee | awk -F'"' '$0=$2')          SSID=$(ifconfig | grep ieee | awk -F'"' '$0=$2')
         ## public ip  #       SSID=$(ifconfig | grep ieee | awk '/join/ {print $3}')
           INTIP=$(ifconfig trunk0 | grep inet | awk '{print $2}')
         IP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'})          IP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'})
         ## printf all the things          printf "  $DATE ${pipe} ${gre}CPU:${rst} $CPU_SPEED ($CPU_TEMPĀ°) ${pipe} ${gre}Free Ram:${rst} $RAM "
         printf "  $DATE ${ora}|${rst} CPU: $CPU_SPEED ($CPU_TEMPĀ°) ${ora}|${rst} Free Ram: $RAM "          printf "${pipe} ${gre}Bat:${rst} $BAT - $BAT_STATUS ${pipe} ${gre}SSID:${rst} $SSID ${pipe}"
         printf "${ora}|${rst} Bat: $BAT - $BAT_STATUS ${ora}|${rst} SSID: $SSID ${ora}|${rst}"          printf " ${gre}Pub. IP:${rst} $IP - ${gre}Int. IP:${rst} $INTIP \r"
         printf " Public IP: $IP \r"          sleep 15
         sleep 1  
 done  done

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

CVSweb
CodeBerg
SourceHut