* etc/byobu/statusrc, usr/lib/byobu/network:

- add support for a network threshold setting; set to 20kbps by default,
    ignore network traffic less than 20kbps; less busy status
This commit is contained in:
Dustin Kirkland 2011-05-25 16:25:13 -05:00
commit b88a75b410
3 changed files with 9 additions and 1 deletions

3
debian/changelog vendored
View file

@ -10,6 +10,9 @@ byobu (4.3) unreleased; urgency=low
- fix the motd display at auto launch, which was broken recently - fix the motd display at auto launch, which was broken recently
* usr/lib/byobu/mem_available: * usr/lib/byobu/mem_available:
- fix MB display bug - fix MB display bug
* etc/byobu/statusrc, usr/lib/byobu/network:
- add support for a network threshold setting; set to 20kbps by default,
ignore network traffic less than 20kbps; less busy status
[ Scott Moser ] [ Scott Moser ]
* usr/lib/byobu/.shutil: fix rounding across a decimal point in fpdiv() * usr/lib/byobu/.shutil: fix rounding across a decimal point in fpdiv()

View file

@ -63,6 +63,7 @@ wifi_quality=1
#LOGO="\o/" #LOGO="\o/"
#MONITORED_DISK=/ #MONITORED_DISK=/
#MONITORED_INTERFACE=eth0 #MONITORED_INTERFACE=eth0
#NETWORK_THRESHOLD=20
#MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature #MONITORED_TEMP=/proc/acpi/thermal_zone/THM0/temperature
#TEMP=F #TEMP=F
#DISTRO=Ubuntu #DISTRO=Ubuntu

View file

@ -31,6 +31,10 @@ else
while read cn other; do interface=$cn; done < /proc/net/route while read cn other; do interface=$cn; done < /proc/net/route
fi fi
# By default, we won't bug the user with the display of network traffic
# below NETWORK_THRESHOLD in kbps; override in $DATA/status
[ -n "$NETWORK_THRESHOLD" ] || NETWORK_THRESHOLD=20
if [ "$1" = "--detail" ]; then if [ "$1" = "--detail" ]; then
LC_ALL=C /sbin/ifconfig "$interface" | sed 's/\s*$//' LC_ALL=C /sbin/ifconfig "$interface" | sed 's/\s*$//'
exit 0 exit 0
@ -91,7 +95,7 @@ for i in up down; do
;; ;;
esac esac
fi fi
if [ "$rate" != "0" ]; then if [ "$rate" -gt $NETWORK_THRESHOLD ]; then
color b m w; printf "%s%s" "$symbol" "$rate"; color -; color m w; printf "%s" "$unit"; color -- color b m w; printf "%s%s" "$symbol" "$rate"; color -; color m w; printf "%s" "$unit"; color --
fi fi
done done