fix(sketchybar): show disk used% instead of free%
All checks were successful
CI / check (push) Successful in 3m27s
All checks were successful
CI / check (push) Successful in 3m27s
Inverts the df output to show percentage used, matching the other resource monitors (CPU, memory). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -632,7 +632,8 @@ in
|
|||||||
text = ''
|
text = ''
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DISK_USAGE=$(df -H / | grep -v Filesystem | awk '{print $5}')
|
# 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}')
|
||||||
|
|
||||||
${pkgs.sketchybar}/bin/sketchybar --set $NAME label="$DISK_USAGE"
|
${pkgs.sketchybar}/bin/sketchybar --set $NAME label="$DISK_USAGE"
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user