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

Battery and disk feature request #19

Open
andraantariksa opened this issue Jul 23, 2020 · 3 comments
Open

Battery and disk feature request #19

andraantariksa opened this issue Jul 23, 2020 · 3 comments

Comments

@andraantariksa
Copy link

I think it will be good if the library has an API for battery (Battery percentage) and disk (R/W speed, capacity, etc). What do you think?

@j8r
Copy link
Collaborator

j8r commented Jul 23, 2020

Good idea. For battery, it is possible through /sys/class/power_supply/BAT0. It will be hard to test because servers don't have ones.
For disk usage, the ideal would be to have statfs (crystal-lang/crystal#6053), but it is possible to use /sys and /proc.

@andraantariksa
Copy link
Author

Thank you for your response. I will try to create a PR for it

@andraantariksa
Copy link
Author

After I think it again, I think I should implement a Power class which will inherit Battery and USB (See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power). So it's not only for battery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants