Display amount of disk available for use

Simple challenge

I have a MacBook with 500gb ssd disk

I would like a simple KM Macro to run at login to advise me / display msg

A: of current amount of disk free e.g. 120 gb xx% available

B : and slightly more strongly if I have less than 100gb free.

Any ideas?

My recommendation is that instead of a warning at login you simply have an item placed into the status bar on the top of your screen that updates every minute, saying how much space you have. That way you always have the free space value easily visible. I'm going for lunch now so I can't write that for you for a while.

Good idea. Here's my take on it:

Free Space.kmmacros (5.4 KB)

2 Likes

Usual caveats about Apple's wacky disk space reporting apply -- for example, df's "Available Space" doesn't include purgeable -- so don't be surprised when every method you use gives you a different answer!

That said, I like @Evan_Mangiamele's above because it is conservative, using powers of 1024 rather than 1000 and considering purgeable space to be unavailable. Much better to under- rather than over-estimate your available elbow-room.

1 Like

I spent the whole day working on an interesting solution. My solution is large enough to merit its own post on another thread on this site. I'll post it in about 2 minutes.

Since I'm learning a little sed, here is my offering.

Available Disk Space.kmmacros (11.4 KB)

Macro Image

KC

1 Like

Thanks for both solutions.
I have selected Evan_Mangiamele 's although it was a close call between them.
I have modded it to a "silent" version that is now included with a cron job I run every 15 minutes. Silent i.e. only notify me if running out of disk space.

1 Like

For a further herculean effort to solve this, see also