Merge pull request #72 from blackheaven/master

More consistent CPU load colors and lower memory usage threshold
This commit is contained in:
Matt McCormick 2022-02-16 17:16:52 -05:00 committed by GitHub
commit 0077534b96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 75 additions and 72 deletions

@ -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] = {

@ -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<<static_cast<unsigned int>(mem_status.used_mem/1024)<<"/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
else if(mem_status.used_mem<100000 && mem_status.total_mem>100000) oss<<static_cast<unsigned int>(mem_status.used_mem)<<"MB/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
else oss<<static_cast<unsigned int>(mem_status.used_mem)<<"/"<<static_cast<unsigned int>(mem_status.total_mem)<<"MB";
if(mem_status.used_mem>10000 && mem_status.total_mem>10000)
oss<<static_cast<unsigned int>(mem_status.used_mem/1024)<<"/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
else if(mem_status.used_mem<10000 && mem_status.total_mem>10000)
oss<<static_cast<unsigned int>(mem_status.used_mem)<<"MB/"<<static_cast<unsigned int>(mem_status.total_mem/1024)<<"GB";
else
oss<<static_cast<unsigned int>(mem_status.used_mem)<<"/"<<static_cast<unsigned int>(mem_status.total_mem)<<"MB";
}
if( use_colors )