small change to statmon
This commit is contained in:
1
hypr/scripts/statmon/.gitignore
vendored
Normal file
1
hypr/scripts/statmon/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/target
|
||||||
@@ -398,11 +398,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
execute!(stdout, cursor::MoveTo(0, 0), Clear(ClearType::FromCursorDown))?;
|
execute!(stdout, cursor::MoveTo(0, 0), Clear(ClearType::FromCursorDown))?;
|
||||||
|
|
||||||
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
||||||
println!("================================================================================================");
|
println!("===============================================================================================");
|
||||||
execute!(stdout, SetForegroundColor(ACCENT))?;
|
execute!(stdout, SetForegroundColor(ACCENT))?;
|
||||||
println!(" SYSTEM DASHBOARD ");
|
println!(" SYSTEM DASHBOARD ");
|
||||||
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
||||||
println!("================================================================================================");
|
println!("===============================================================================================");
|
||||||
|
|
||||||
print_line(&mut stdout, "Time", &time_str, ACCENT)?;
|
print_line(&mut stdout, "Time", &time_str, ACCENT)?;
|
||||||
print_line(&mut stdout, "Laptop Bat", &bat_str, FG_MAIN)?;
|
print_line(&mut stdout, "Laptop Bat", &bat_str, FG_MAIN)?;
|
||||||
@@ -435,11 +435,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
// Render Top 5 Table
|
// Render Top 5 Table
|
||||||
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
||||||
println!("------------------------------------------------------------------------------------------------");
|
println!("-----------------------------------------------------------------------------------------------");
|
||||||
execute!(stdout, SetForegroundColor(ACCENT))?;
|
execute!(stdout, SetForegroundColor(ACCENT))?;
|
||||||
println!(" {:<8} {:<30} {:<12} {:<12}", "PID", "NAME", "CPU %", "MEM (MB)");
|
println!(" {:<8} {:<30} {:<12} {:<12}", "PID", "NAME", "CPU %", "MEM (MB)");
|
||||||
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
||||||
println!("------------------------------------------------------------------------------------------------");
|
println!("-----------------------------------------------------------------------------------------------");
|
||||||
|
|
||||||
for p in top_5 {
|
for p in top_5 {
|
||||||
let raw_name = p.name();
|
let raw_name = p.name();
|
||||||
@@ -461,7 +461,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
execute!(stdout, SetForegroundColor(FG_MAIN))?;
|
||||||
println!("================================================================================================");
|
println!("===============================================================================================");
|
||||||
|
|
||||||
if global_cpu > 85.0 || mem_pct > 90.0 || temp_val > 85.0 {
|
if global_cpu > 85.0 || mem_pct > 90.0 || temp_val > 85.0 {
|
||||||
execute!(stdout, SetForegroundColor(ALERT))?;
|
execute!(stdout, SetForegroundColor(ALERT))?;
|
||||||
|
|||||||
Reference in New Issue
Block a user