diff --git a/common/luts.h b/common/luts.h index 0c99e08..81fc58c 100644 --- a/common/luts.h +++ b/common/luts.h @@ -5,8 +5,74 @@ static const char cpu_percentage_lut[][32] = { "#[fg=brightwhite,bg=colour16]", "#[fg=brightwhite,bg=colour16]", "#[fg=brightwhite,bg=colour16]", -"#[fg=brightwhite,bg=colour52]", -"#[fg=brightwhite,bg=colour52]", +"#[fg=brightwhite,bg=colour16]", +"#[fg=brightwhite,bg=colour16]", +"#[fg=brightwhite,bg=colour16]", +"#[fg=brightwhite,bg=colour16]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour17]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour18]", +"#[fg=brightwhite,bg=colour19]", +"#[fg=brightwhite,bg=colour19]", +"#[fg=brightwhite,bg=colour19]", +"#[fg=brightwhite,bg=colour19]", +"#[fg=brightwhite,bg=colour19]", +"#[fg=brightwhite,bg=colour19]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour20]", +"#[fg=brightwhite,bg=colour21]", +"#[fg=brightwhite,bg=colour21]", +"#[fg=brightwhite,bg=colour21]", +"#[fg=brightwhite,bg=colour21]", +"#[fg=brightwhite,bg=colour21]", +"#[fg=brightwhite,bg=colour21]", +"#[fg=brightwhite,bg=colour57]", +"#[fg=brightwhite,bg=colour57]", +"#[fg=brightwhite,bg=colour57]", +"#[fg=brightwhite,bg=colour57]", +"#[fg=brightwhite,bg=colour57]", +"#[fg=brightwhite,bg=colour57]", +"#[fg=brightwhite,bg=colour56]", +"#[fg=brightwhite,bg=colour56]", +"#[fg=brightwhite,bg=colour56]", +"#[fg=brightwhite,bg=colour56]", +"#[fg=brightwhite,bg=colour56]", +"#[fg=brightwhite,bg=colour56]", +"#[fg=brightwhite,bg=colour55]", +"#[fg=brightwhite,bg=colour55]", +"#[fg=brightwhite,bg=colour55]", +"#[fg=brightwhite,bg=colour55]", +"#[fg=brightwhite,bg=colour55]", +"#[fg=brightwhite,bg=colour55]", +"#[fg=brightwhite,bg=colour54]", +"#[fg=brightwhite,bg=colour54]", +"#[fg=brightwhite,bg=colour54]", +"#[fg=brightwhite,bg=colour54]", +"#[fg=brightwhite,bg=colour54]", +"#[fg=brightwhite,bg=colour54]", +"#[fg=brightwhite,bg=colour53]", +"#[fg=brightwhite,bg=colour53]", +"#[fg=brightwhite,bg=colour53]", +"#[fg=brightwhite,bg=colour53]", +"#[fg=brightwhite,bg=colour53]", +"#[fg=brightwhite,bg=colour53]", "#[fg=brightwhite,bg=colour52]", "#[fg=brightwhite,bg=colour52]", "#[fg=brightwhite,bg=colour52]", @@ -19,16 +85,12 @@ static const char cpu_percentage_lut[][32] = { "#[fg=brightwhite,bg=colour88]", "#[fg=brightwhite,bg=colour88]", "#[fg=brightwhite,bg=colour88]", -"#[fg=brightwhite,bg=colour88]", "#[fg=brightwhite,bg=colour124]", "#[fg=brightwhite,bg=colour124]", "#[fg=brightwhite,bg=colour124]", "#[fg=brightwhite,bg=colour124]", "#[fg=brightwhite,bg=colour124]", "#[fg=brightwhite,bg=colour124]", -"#[fg=brightwhite,bg=colour124]", -"#[fg=brightwhite,bg=colour160]", -"#[fg=brightwhite,bg=colour160]", "#[fg=brightwhite,bg=colour160]", "#[fg=brightwhite,bg=colour160]", "#[fg=brightwhite,bg=colour160]", @@ -40,69 +102,7 @@ static const char cpu_percentage_lut[][32] = { "#[fg=brightwhite,bg=colour196]", "#[fg=brightwhite,bg=colour196]", "#[fg=brightwhite,bg=colour196]", -"#[fg=brightwhite,bg=colour196]", -"#[fg=brightwhite,bg=colour196]", -"#[fg=brightwhite,bg=colour196]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour202]", -"#[fg=brightwhite,bg=colour208]", -"#[fg=black,bg=colour208]", -"#[fg=black,bg=colour208]", -"#[fg=black,bg=colour208]", -"#[fg=black,bg=colour208]", -"#[fg=black,bg=colour208]", -"#[fg=black,bg=colour208]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour214]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour220]", -"#[fg=black,bg=colour226]", -"#[fg=black,bg=colour226]", -"#[fg=black,bg=colour226]", -"#[fg=black,bg=colour226]", -"#[fg=black,bg=colour226]", -"#[fg=black,bg=colour226]", -"#[fg=black,bg=colour227]", -"#[fg=black,bg=colour227]", -"#[fg=black,bg=colour227]", -"#[fg=black,bg=colour227]", -"#[fg=black,bg=colour227]", -"#[fg=black,bg=colour227]", -"#[fg=black,bg=colour228]", -"#[fg=black,bg=colour228]", -"#[fg=black,bg=colour228]", -"#[fg=black,bg=colour228]", -"#[fg=black,bg=colour228]", -"#[fg=black,bg=colour229]", -"#[fg=black,bg=colour229]", -"#[fg=black,bg=colour229]", -"#[fg=black,bg=colour229]", -"#[fg=black,bg=colour229]", -"#[fg=black,bg=colour230]", -"#[fg=black,bg=colour230]", -"#[fg=black,bg=colour230]", -"#[fg=black,bg=colour230]", -"#[fg=black,bg=colour230]", -"#[fg=black,bg=colour231]", -"#[fg=black,bg=colour231]", -"#[fg=black,bg=colour231]" +"#[fg=brightwhite,bg=colour196]" }; // end cpu_percentage_lut static const char mem_lut[][32] = { diff --git a/common/memory.cc b/common/memory.cc index 423e6b2..6e09f84 100644 --- a/common/memory.cc +++ b/common/memory.cc @@ -84,9 +84,12 @@ std::string mem_string( const MemoryStatus & mem_status, break; } default: // Default mode, just show the used/total memory in MB - if(mem_status.used_mem>100000 && mem_status.total_mem>100000) oss<(mem_status.used_mem/1024)<<"/"<(mem_status.total_mem/1024)<<"GB"; - else if(mem_status.used_mem<100000 && mem_status.total_mem>100000) oss<(mem_status.used_mem)<<"MB/"<(mem_status.total_mem/1024)<<"GB"; - else oss<(mem_status.used_mem)<<"/"<(mem_status.total_mem)<<"MB"; + if(mem_status.used_mem>10000 && mem_status.total_mem>10000) + oss<(mem_status.used_mem/1024)<<"/"<(mem_status.total_mem/1024)<<"GB"; + else if(mem_status.used_mem<10000 && mem_status.total_mem>10000) + oss<(mem_status.used_mem)<<"MB/"<(mem_status.total_mem/1024)<<"GB"; + else + oss<(mem_status.used_mem)<<"/"<(mem_status.total_mem)<<"MB"; } if( use_colors )