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

Diff for /dotfiles/termbar/termbar between version 1.5 and 1.6

version 1.5, 2020/06/08 15:38:24 version 1.6, 2020/09/30 08:56:30
Line 3 
Line 3 
 ## Debug  ## Debug
 #set -x  #set -x
   
   trap 'exec $0' HUP # Restart itself
   trap 'tput cnorm; exit 1' INT QUIT TERM
   
 esc="\033"  esc="\033"
 reset="${esc}[0m"  reset="${esc}[0m"
 redf="${esc}[31m"  redf="${esc}[31m"
Line 12  pipe="${purplef}|${reset}"
Line 15  pipe="${purplef}|${reset}"
   
 today()  today()
 {  {
         DATE=$(date +"%B %d - %H:%M")          DATE=$(date '+%a %d %b %H:%M')
 }  }
   
   desktop_id()
   {
           DESKTOP_ID=$(xprop -root 32c '\t$0' _NET_CURRENT_DESKTOP | cut -f 2)
   }
   
 cpu()  cpu()
 {  {
         CPU_TEMP=$(sysctl hw.sensors.cpu0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1)          CPU_TEMP=$(sysctl hw.sensors.ksmn0.temp0 | cut -d "=" -f 2 | cut -d "." -f 1)
         CPU_SPEED=$(printf "%4s" $(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1))          CPU_SPEED=$(printf "%4s" $(sysctl hw.cpuspeed | cut -d "=" -f 2 | cut -d "." -f 1))
 }  }
   
Line 49  wifi()
Line 57  wifi()
   
 network()  network()
 {  {
         IIP=$(ifconfig trunk0 | grep inet | awk '{print $2}')          IIP=$(ifconfig iwm0 | grep inet | awk '{print $2}')
         PIP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'})          PIP=$(dig +short myip.opendns.com @resolver1.opendns.com | awk {'printf $1'})
 }  }
   
   tput civis
   
 while true; do  while true; do
         today          today
           desktop_id
         cpu          cpu
         mem          mem
         bat          bat
         bat_status          bat_status
         wifi          wifi
         network          network
         printf "  ${DATE} ${pipe} ${cyanf}CPU:${reset} ${CPU_SPEED} MHz (${CPU_TEMP}°) ${pipe} ${cyanf}Mem:${reset} ${MEM} "          tput cup 1 0
           printf "[${DESKTOP_ID}] ${DATE} ${pipe} ${cyanf}CPU:${reset} ${CPU_SPEED} MHz (${CPU_TEMP}°) ${pipe} ${cyanf}Mem:${reset} ${MEM} "
         printf "${pipe} ${cyanf}Bat:${reset} $BAT - ${BAT_STATUS} ${pipe} ${cyanf}SSID:${reset}${SSID}${pipe}"          printf "${pipe} ${cyanf}Bat:${reset} $BAT - ${BAT_STATUS} ${pipe} ${cyanf}SSID:${reset}${SSID}${pipe}"
         printf " ${cyanf}IPs:${reset} ${PIP} / ${IIP} \r"          printf " ${cyanf}IPs:${reset} ${IIP} / ${PIP} \r\r"
         sleep 15          sleep 1
 done  done

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

CVSweb
CodeBerg
SourceHut