feat: configurable colors

This commit is contained in:
Quixaq 2026-06-10 21:18:41 +02:00
commit b410fbe5a6
No known key found for this signature in database
4 changed files with 133 additions and 17 deletions

View file

@ -1,3 +1,5 @@
include!(concat!(env!("OUT_DIR"), "/color_helpers.rs"));
use alloc::string::String;
use core::mem::MaybeUninit;
@ -88,11 +90,11 @@ pub fn get_root_disk_usage() -> Result<String, Error> {
result.push_str(" GiB / ");
write_float(&mut result, total_size, 2);
result.push_str(" GiB (");
result.push_str(colors.cyan);
result.push_str(colors.icon);
write_float(&mut result, usage, 0);
result.push('%');
result.push_str(colors.reset);
result.push(')');
result.push_str(RPAREN);
Ok(result)
}
@ -258,11 +260,11 @@ pub fn get_memory_usage() -> Result<String, Error> {
result.push_str(" GiB / ");
write_float(&mut result, total_memory, 2);
result.push_str(" GiB (");
result.push_str(colors.cyan);
result.push_str(colors.icon);
write_u64(&mut result, percentage_used);
result.push('%');
result.push_str(colors.reset);
result.push(')');
result.push_str(RPAREN);
Ok(result)
}