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

feat: add disk provider #138

Merged
merged 3 commits into from
Nov 4, 2024
Merged

Conversation

veryard
Copy link
Contributor

@veryard veryard commented Nov 1, 2024

This PR adds a widget for disk information, uses the sysinfo package that is already included within.

image


let mut list = Vec::new();

for disk in disks.iter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use .map(...).collect::<Vec<_>>() to simplify this and avoid the mut on list

total_space: disk.total_space(),
available_space: disk.available_space(),
is_removable: disk.is_removable(),
disk_type: format!("{:?}", disk.kind()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disk.kind().display() can be used instead of format!(...)

@lars-berger lars-berger changed the title feat(widget): Add Disk widget feat: add disk provider Nov 4, 2024
@lars-berger
Copy link
Member

Much needed, thank you 🙌

To fix formatting you can use cargo fmt. It gets pretty annoying to run manually though. If you're on VSC, you can install rust analyzer and then enable format on save via "editor.formatOnSave": true

@veryard
Copy link
Contributor Author

veryard commented Nov 4, 2024

Thanks for the feedback, really appreciated! Have gone ahead and made some changes, please let me know if I've missed anything or made things worse!

image

@lars-berger lars-berger merged commit 9145098 into glzr-io:main Nov 4, 2024
Copy link

🎉 This PR is included in version 2.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants