Commit 88aa4c145bb5

Vincent Demeester <vincent@sbr.pm>
2025-06-18 15:08:22
tools/battery-monitor: switch to watch the folder
But it doesn't seem it works anyway… Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 6dd4650
Changed files (1)
tools
battery-monitor
tools/battery-monitor/main.go
@@ -98,17 +98,11 @@ func main() {
 		}
 	}()
 
-	err = watcher.Add(capacityFilePath)
+	err = watcher.Add(*batteryPath)
 	if err != nil {
-		log.Fatalf("Error adding %s to watcher: %v", capacityFilePath, err)
+		log.Fatalf("Error adding %s to watcher: %v", *batteryPath, err)
 	}
-	log.Printf("Watching %s for changes...", capacityFilePath)
-
-	err = watcher.Add(statusFilePath)
-	if err != nil {
-		log.Fatalf("Error adding %s to watcher: %v", statusFilePath, err)
-	}
-	log.Printf("Watching %s for changes...", statusFilePath)
+	log.Printf("Watching %s for changes...", *batteryPath)
 
 	<-done // Keep the main goroutine alive
 }