made it more sexable

This commit is contained in:
xomf 2024-06-16 13:08:18 -04:00
parent c816c1025e
commit 793ed4d730

View File

@ -23,7 +23,7 @@ impl DimPlugin for Plug {
fn init(&mut self) {
}
fn poll(&mut self, f: &mut dim_sdk::CBuffer) -> dim_sdk::Result<()> {
let contents = read_to_string("/home/xomf/battery_test")?;
let contents = read_to_string("/sys/class/power_supply/BAT0/capacity")?;
let cleaned_contents: String = contents.chars().filter(|c| c.is_digit(10)).collect();
write!(f, "Battery: {}%", cleaned_contents)?;