config: Generate configs

This commit is contained in:
Kenny Levinsen
2023-02-12 17:02:44 +01:00
parent db085168dc
commit 9e48eb053d
7 changed files with 179 additions and 104 deletions
+8
View File
@@ -39,6 +39,14 @@ impl Backlight {
dev.update();
BarWidget::new(Box::new(dev), fm, font, size)
}
pub fn detect(path: &str) -> bool {
let path = Path::new("/sys/class/backlight").to_path_buf().join(path);
match read_file_as_u64(path.join("brightness").as_path()) {
Ok(_) => true,
Err(_) => false,
}
}
}
impl BarWidgetImpl for Backlight {