From 188d2befb0a3885acc3fd6c8990d5c4378b57b81 Mon Sep 17 00:00:00 2001 From: John Ogle Date: Tue, 27 Jan 2026 11:32:48 -0800 Subject: [PATCH] Fix sketchybar disk usage showing incorrect percentage Monitor /System/Volumes/Data instead of / since root is a read-only APFS snapshot with minimal usage. Also fix inverted formula that was calculating 100-used instead of just using the capacity value directly. --- home/roles/aerospace/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/home/roles/aerospace/default.nix b/home/roles/aerospace/default.nix index 43a592d..f7253ba 100644 --- a/home/roles/aerospace/default.nix +++ b/home/roles/aerospace/default.nix @@ -632,8 +632,9 @@ in text = '' #!/bin/bash - # df $5 can show free% on some APFS setups; calculate used% explicitly - DISK_USAGE=$(df -H / | grep -v Filesystem | awk '{gsub(/%/,"",$5); printf "%.0f%%", 100-$5}') + # Monitor /System/Volumes/Data which contains user data on APFS + # The root / is a read-only snapshot with minimal usage + DISK_USAGE=$(df -H /System/Volumes/Data | grep -v Filesystem | awk '{print $5}') ${pkgs.sketchybar}/bin/sketchybar --set $NAME label="$DISK_USAGE" '';