Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display total size of current directory #229

Open
fritzrehde opened this issue Nov 26, 2022 · 3 comments · May be fixed by #334
Open

Display total size of current directory #229

fritzrehde opened this issue Nov 26, 2022 · 3 comments · May be fixed by #334
Labels
enhancement New feature or request

Comments

@fritzrehde
Copy link
Contributor

I would like to somehow display the total size of a directory's content (like joshuto does with files).
Out of curiousity, is there a reason this isn't implemented directly into joshuto already? The same feature exists for files. The argument against it is probably the performance overhead (I imagine it would be terribly slow for deeply nested directories). Maybe this could be added as an option that can be toggled on or off with a keybinding (I could look into it). You're in a parent directory of directories you want to know the size of, toggle the option, see the size, and toggle back off when you want performance again.
If you don't want this implemented directly into joshuto: The command du -sh "$DIRECTORY" would easliy let me do that for a single directory. But is there a way to manually (through a keybinding) call this command on a line in joshuto and somehow display the output somewhere in joshuto?

@kamiyaa kamiyaa added the enhancement New feature or request label Dec 4, 2022
@krivahtoo
Copy link
Contributor

@kamiyaa What do you think of adding this by calulating the actual size of the directory contents instead of counting entries in JoshutoMetadata::_directory_size?

We don't have to completely remove count, there could be an option to toggle between count and size.

Here is a preview of what I was able to put together.
2023-05-05-194153_663x405_scrot

@DLFW
Copy link
Contributor

DLFW commented May 5, 2023

Is this recursive?

@krivahtoo
Copy link
Contributor

No, it only calculates a single depth and updates lazily as you navigate.

@krivahtoo krivahtoo linked a pull request Jun 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants