#!/bin/sh
#241222 sfs
cfg="$HOME/.config/sfwbar/sfwbar.ini"
[ -f "$cfg" ] && . "$cfg" || hwmon=1
HW(){
[ "$hwmon" ] || hwmon=1
n="`cat  /sys/class/hwmon/hwmon${hwmon}/name`"
#cat "$cfg"
#echo "Set HwMon = $hwmon"
#echo 'Set HwMon = "/sys/class/hwmon/hwmon'$hwmon'/temp1_input"'
echo '
  file("/sys/class/hwmon/hwmon'$hwmon'/temp1_input") {
    CPUTemp1 = Grab(First)
  }
  Set CPUTempN = "'$n'"
  Set BluezScanTO = "'$blue'"

'
}
ETH(){
#eth=eth0
#max traf
[ "$if" ] || if="`awk -F: '!/face/ && !/Inter/ {print $2":"$1}' /proc/net/dev|sort -n|tail -1|awk  -F: '{print $2}' |tr -d " "`"
echo '
  Exec("grep '$if' /proc/net/dev") {
    EthRcvd = RegEx(".*:[\t ]*([0-9]+)",Sum)
    EthSent = RegEx(".*:(?:[\t ]*[0-9]+){8}[\t ]([0-9]+)",Sum)
    Eth = RegEx("^([^:]+):")
  }
'
}
HW
