feat: colors

This commit is contained in:
neoarz
2026-01-07 15:20:48 -05:00
parent 20868595a8
commit 0f84471a9f
9 changed files with 109 additions and 40 deletions

View File

@@ -75,7 +75,7 @@ pub fn get_battery_info() -> String {
status.push_str("Discharging");
}
let mut result = format!("({}) {}%", device_name, percentage);
let mut result = format!("({}) {}", device_name, crate::output::colors::battery_percent(percentage));
if !external_connected && !is_charging {
if let Some(time_mins) = avg_time_to_empty {

View File

@@ -23,7 +23,7 @@ pub fn get_display_info() -> String {
};
format!(
"Display ({}): {}x{} @ {}x in {}\", {} Hz {}",
"({}): {}x{} @ {}x in {}\", {} Hz {}",
name, p_width, p_height, main.scale_factor as u32, inches, main.frequency as u32, tag
)
} else {

View File

@@ -73,7 +73,7 @@ pub fn get_memory_info() -> String {
};
format!(
"{:.2} GiB / {:.2} GiB ({:.0}%)",
used_gib, total_gib, percentage
"{:.2} GiB / {:.2} GiB ({})",
used_gib, total_gib, crate::output::colors::percent(percentage)
)
}

View File

@@ -78,8 +78,8 @@ pub fn get_storage_info() -> String {
let read_only = (fs.f_flags & MNT_RDONLY) != 0;
let mut result = format!(
"{:.2} GiB / {:.2} GiB ({:.0}%)",
used_gib, total_gib, percentage
"{:.2} GiB / {:.2} GiB ({})",
used_gib, total_gib, crate::output::colors::percent(percentage)
);
if !filesystem.is_empty() {

View File

@@ -32,8 +32,8 @@ pub fn get_swap_info() -> String {
};
return format!(
"{:.2} GiB / {:.2} GiB ({:.0}%)",
used_gib, total_gib, percentage
"{:.2} GiB / {:.2} GiB ({})",
used_gib, total_gib, crate::output::colors::percent(percentage)
);
}