]> Sergey Matveev's repositories - godwmstat.git/blobdiff - main.go
Fix Swap parse
[godwmstat.git] / main.go
diff --git a/main.go b/main.go
index 0ba2810c5276cc9f931f1a34904dbc1ab9e541a3..04cca53140ad7e44e005d908e465391a517ce1a2 100644 (file)
--- a/main.go
+++ b/main.go
@@ -76,7 +76,7 @@ func top() {
                case "ARC:":
                        ARC = cols[1]
                case "Swap:":
-                       if cols[4] == "Used," {
+                       if len(cols) >= 5 && cols[4] == "Used," {
                                Swap = cols[3] + " Swap "
                        } else {
                                Swap = ""
@@ -129,7 +129,7 @@ func flagfiles() {
 
 func main() {
        xsetroot := flag.Bool("xsetroot", false, "Call xsetroot")
-       iodevs := flag.String("iodevs", "ada0 ada1", "iostat devices")
+       iodevs := flag.String("iodevs", "nvd0 nvd1", "iostat devices")
        refresh := flag.Uint("refresh", 2, "Refresh interval")
        flag.Parse()
        N = strconv.Itoa(int(*refresh))