Skip to content

Commit

Permalink
updated ram view
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Apr 4, 2024
1 parent d5c9cf4 commit 96901aa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() {
let mut uptime: String = format!("{} minutes", uptime_minutes);

if uptime_hours != 0 {
uptime = format!("{} hours, {}", uptime_hours, uptime);
uptime = format!("{} hour(s) {}", uptime_hours, uptime);
}

// information variables
Expand All @@ -92,8 +92,9 @@ fn main() {
let distro = general_readout.distribution().unwrap_or_default();
let cpu = general_readout.cpu_model_name().unwrap_or_default();
let cpu_cores = general_readout.cpu_cores().unwrap_or_default();
let total_ram = memory_readout.total().unwrap_or_default() / 1024;
let used_ram = memory_readout.used().unwrap_or_default() / 1024;
let total_ram = memory_readout.total().unwrap() as usize / 1024;
let used_ram = memory_readout.used().unwrap() as usize / 1024;
let cached_ram = memory_readout.cached().unwrap() as usize / 1024;
let machine = general_readout.machine().unwrap_or_default();

// battery information
Expand Down Expand Up @@ -156,13 +157,13 @@ fn main() {
{} {}
{} {} [{}]
{} {}
{} {} / {} MB
{} {} / {} MB ({} MB cached)
{} {}
", "~ system info ~".bright_blue(),
"user".bright_yellow(), username,
"os".bright_purple(), os, distro.bright_yellow(),
"up".bright_red(), uptime,
"ram".bright_yellow(), used_ram, total_ram,
"ram".bright_yellow(), used_ram, total_ram, cached_ram,
"bat".bright_green(), _battery_text,
);

Expand Down

0 comments on commit 96901aa

Please sign in to comment.