hardware
hardware copied to clipboard
Battery and disk feature request
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?
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 (https://github.com/crystal-lang/crystal/issues/6053), but it is possible to use /sys
and /proc
.
Thank you for your response. I will try to create a PR for it
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