summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSophie Tauchert <999eagle@999eagle.moe>2018-12-03 10:55:39 +0100
committerSophie Tauchert <999eagle@999eagle.moe>2018-12-03 10:55:39 +0100
commit40260a8e0447bc5aea007b7d922450561a1c0990 (patch)
tree076927a3e85ef34afa8058449ec5a5d3773bef97
parent1ab25d0f169bdd3d5823dbe70b63e99950f05f55 (diff)
Filter loop devices in disk stats
-rw-r--r--src/widgets/disk.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/disk.go b/src/widgets/disk.go
index 82b416e..98904de 100644
--- a/src/widgets/disk.go
+++ b/src/widgets/disk.go
@@ -57,6 +57,10 @@ func (self *Disk) update() {
// add partition if it's new
for _, Part := range Partitions {
device := strings.Replace(Part.Device, "/dev/", "", -1)
+ // don't show loop devices
+ if strings.HasPrefix(device, "loop") {
+ continue
+ }
if _, ok := self.Partitions[device]; !ok {
// https://github.com/shirou/gopsutil/issues/555
// have to remove artifacts produced by gopsutil when there's a space in the mount path