diff --git a/bin/wifi_quality b/bin/wifi_quality index c8ec6806..a127ebbb 100755 --- a/bin/wifi_quality +++ b/bin/wifi_quality @@ -17,14 +17,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -interface=`/sbin/route -n | tail -n 1 | sed "s/^.* //"` - if [ "$1" = "--detail" ]; then /sbin/iwconfig 2>/dev/null exit 0 fi -bitrate=`/sbin/iwconfig "$interface" 2>/dev/null | grep "Bit Rate." | sed "s/^.*Bit Rate.//" | sed "s/ .*$//g"` +iwconfig=`/sbin/iwconfig 2>/dev/null` +bitrate=`echo "$iwconfig" | grep "Bit Rate." | sed "s/^.*Bit Rate.//" | sed "s/ .*$//g"` [ -z "$bitrate" ] && bitrate="0" -quality=`/sbin/iwconfig "$interface" 2>/dev/null | grep "Link Quality=" | sed "s/^.*Link Quality=//" | sed "s/ .*$//g"` +quality=`echo "$iwconfig" | grep "Link Quality=" | sed "s/^.*Link Quality=//" | sed "s/ .*$//g"` echo "$bitrate" "$quality" | awk '{printf "\005{=b Ck}%s\005{-}\005{= Ck}Mb/s,\005{-}\005{=b Ck}%.0f\005{-}\005{= Ck}%%\005{-} ", $1, $2}' diff --git a/debian/changelog b/debian/changelog index 44eb82b9..b91f3bd3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,13 @@ byobu (2.12) unreleased; urgency=low all status scripts from *-* to *_*; this allows us to source the ~/.byobu/status file, rather than grepping through it for configuration information, yielding significant performance improvements, LP: #386546 + * profiles/common: drop mem-used to run every 10 seconds, and disk-used to + run every 30 seconds, and wifi_quality to run every 10 seconds + * bin/wifi_quality: significant performance improvements, remove unneeded + route call, cache iwconfig output so that it's only called once - -- Dustin Kirkland Tue, 16 Jun 2009 14:44:43 -0500 + + -- Dustin Kirkland Tue, 16 Jun 2009 15:35:30 -0500 byobu (2.11-0ubuntu1) karmic; urgency=low diff --git a/profiles/common b/profiles/common index 8dfc9f55..847a40c7 100644 --- a/profiles/common +++ b/profiles/common @@ -34,7 +34,7 @@ backtick 103 2 2 byobu-status cpu_freq backtick 104 86400 86400 byobu-status cpu_count backtick 105 86400 86400 byobu-status mem_available backtick 106 2 2 byobu-status load_average -backtick 107 2 2 byobu-status mem_used +backtick 107 10 10 byobu-status mem_used backtick 108 600 600 byobu-status ec2_cost backtick 109 3600 3600 byobu-status hostname backtick 110 86400 86400 byobu-status whoami @@ -46,12 +46,12 @@ backtick 115 60 60 byobu-status uptime backtick 116 2 2 byobu-status processes backtick 117 2 2 byobu-status network_up backtick 118 2 2 byobu-status network_down -backtick 119 2 2 byobu-status wifi_quality +backtick 119 10 10 byobu-status wifi_quality backtick 120 86400 86400 byobu-status date backtick 121 86400 86400 byobu-status time backtick 122 3600 3600 byobu-status ip_address backtick 123 86400 86400 byobu-status disk_available -backtick 124 2 2 byobu-status disk_used +backtick 124 30 30 byobu-status disk_used backtick 125 30 30 byobu-status temp_c backtick 126 30 30 byobu-status temp_f