imsnif / diskonaut

Terminal disk space navigator 🔭
MIT License
2.48k stars 66 forks source link

Feature: option to include free disk space #24

Open jansegre opened 4 years ago

jansegre commented 4 years ago

This may only make sense when scanning whole mounts, but it would be nice to have a visual feedback no how much free space there is. It could start as something as simples as a special node/branch that accounts for what df would returnn on the given path. Like diskonaut /foo/bar would include a special colored "free space" with the size of df /foo/bar.

zicklag commented 4 years ago

This may only make sense when scanning whole mounts,

I don't think so. I was just specifically using this tool to free up space on a drive that had run out of space, but I know which folders I can afford to delete stuff from, so I'm not working on the whole drive. Knowing when I have freed enough to make me comfortable, without having to leave the tool and df -h would be nice.

It's a great idea.

imsnif commented 4 years ago

I like this idea. I can't imagine how we can have a visual "graphical" representation of free space in anything except scanning a whole drive. After all, the free space if in the drive, not in a particular folder. Otherwise I'd think we would have a "free space" tile in every folder, having it mostly blot out the contents of smaller folders.

How about if we include it as part of the title line? Right now the title line has a "freed" section which shows you how much space you've freed in this session. Maybe we could add something like: Free space in /: 50G to the title? And then have diskonaut detect which drive the folder you're scanning is on and present it? So that (for example) if I'm scanning /home/aram which is on the /home partition, I'll see Free space in /home: 50GB in the title line?

What do you think?

zicklag commented 4 years ago

That sounds perfect.

jansegre commented 4 years ago

That's exactly what df does. If the given path is not a drive/filesystem it tries to figure out what drive/filesystem the file is from. From the manual:

df [-b | -h | -H | -k | -m | -g | -P] [-ailn] [-t] [-T type] [file | filesystem ...] The df utility displays statistics about the amount of free disk space on the specified filesystem or on the filesystem of which file is a part.

dbramucci commented 4 years ago

What do you think of an (optional?) ui element indicating where you would be if you deleted a folder? Something like

Free space in /: 50G  --------------------------> 39.5G
                          <CTRL-D> Desktop/ 10.4G

That way users could avoid mental math and the rounding error from the displayed numbers would matter less.

imsnif commented 4 years ago

@dbramucci - I really like that idea. The realestate in the title is a little scarce though. Would you like to open a separate issue to discuss the details?