Flags string = "?"
IOs string = "?"
Net string = "?"
- N string = "?"
)
func piper(c chan []string, name string, args ...string) error {
func iostat() {
var stats []string
- for cols := range bg("iostat", "-d", "-w", N, "-x") {
+ for cols := range bg("iostat", "-d", "-w", "1", "-x") {
if cols[0] == "device" {
IOs = strings.Join(stats, " ")
stats = nil
}
func netstat() {
- for cols := range bg("netstat", "-n", N) {
+ for cols := range bg("netstat", "-I", "bridge0", "-n", "1") {
if _, err := strconv.Atoi(cols[0]); err != nil {
continue
}
func main() {
xsetroot := flag.Bool("xsetroot", false, "Call xsetroot")
- refresh := flag.Uint("refresh", 2, "Refresh interval")
flag.Parse()
- N = strconv.Itoa(int(*refresh))
go func() {
for {
flagfiles()
} else {
fmt.Println(status)
}
- time.Sleep(time.Duration(*refresh) * time.Second)
+ time.Sleep(time.Second)
}
}