move formatting logic to the scripts itself to avoid execution on every update interval - reduces cpu time of conly massively
This commit is contained in:
@@ -18,5 +18,5 @@ sysctl hw.sensors | { while read _sensor _rest; do
|
||||
esac
|
||||
|
||||
done
|
||||
[[ ${_count} -ne 0 ]] && print $(( _temp /= ${_count} ))
|
||||
[[ ${_count} -ne 0 ]] && printf "%2.2s" $(( _temp /= ${_count} ))
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
_sep=":"
|
||||
_sep=':'
|
||||
|
||||
ifconfig wlan | { while read _line; do
|
||||
|
||||
@@ -34,15 +34,21 @@ ifconfig wlan | { while read _line; do
|
||||
case ${_arg} in
|
||||
|
||||
sig)
|
||||
set -A WIFI ${WIFI[*]} ${WIFI:+${_sep}} ${_sig}
|
||||
printf "%s" ${_count:+\ ${_sep}\ }
|
||||
printf "%3.3s" ${_sig}
|
||||
[[ ${#@} -gt 1 ]] && printf "%s" "%"
|
||||
_count=1
|
||||
;;
|
||||
sid)
|
||||
set -A WIFI ${WIFI[*]} ${WIFI:+${_sep}} ${_sid}
|
||||
printf "%s" ${_count:+\ ${_sep}\ }
|
||||
printf "%s" ${_sid}
|
||||
_count=1
|
||||
;;
|
||||
ip)
|
||||
set -A WIFI ${WIFI[*]} ${WIFI:+${_sep}} ${_ip}
|
||||
printf "%s" ${_count:+\ ${_sep}\ }
|
||||
printf "%s" ${_ip}
|
||||
_count=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
print ${WIFI[*]}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user