From 6022f4c80ded869322caa25906adc98d587db6e7 Mon Sep 17 00:00:00 2001 From: Jay Clark Date: Thu, 25 Jun 2015 14:48:43 -0600 Subject: [PATCH] Implement fix suggested in #44 by @stalegjelsten --- network-throughput/network-throughput.widget/index.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network-throughput/network-throughput.widget/index.coffee b/network-throughput/network-throughput.widget/index.coffee index 1bbfbeb..3ec3286 100644 --- a/network-throughput/network-throughput.widget/index.coffee +++ b/network-throughput/network-throughput.widget/index.coffee @@ -2,11 +2,11 @@ network_interface = 'en0' # Sample for one second, one time # The command actually takes longer than 1 second to execute -command: "sar -n DEV 1 1 | grep #{network_interface} | tail -n1 | awk '{print $4,$6}'" +command: "sar -n DEV 1 1 2> /dev/null | awk '/#{network_interface}/{x++}x==2 {print $4,$6;exit}'" # Even though the command takes longer than 1 second to execute, 1000ms # seems to work best (widget output updates approx every 3 seconds) -refreshFrequency: 1000 +refreshFrequency: 3000 style: """ top: 20px