Merge pull request #72 from blackheaven/master
More consistent CPU load colors and lower memory usage threshold
This commit is contained in:
commit
0077534b96
138
common/luts.h
138
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=colour16]",
|
||||||
"#[fg=brightwhite,bg=colour16]",
|
"#[fg=brightwhite,bg=colour16]",
|
||||||
"#[fg=brightwhite,bg=colour52]",
|
"#[fg=brightwhite,bg=colour16]",
|
||||||
"#[fg=brightwhite,bg=colour52]",
|
"#[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]",
|
"#[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=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=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]",
|
"#[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=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]"
|
|
||||||
}; // end cpu_percentage_lut
|
}; // end cpu_percentage_lut
|
||||||
|
|
||||||
static const char mem_lut[][32] = {
|
static const char mem_lut[][32] = {
|
||||||
|
@ -84,9 +84,12 @@ std::string mem_string( const MemoryStatus & mem_status,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: // Default mode, just show the used/total memory in MB
|
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";
|
if(mem_status.used_mem>10000 && mem_status.total_mem>10000)
|
||||||
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";
|
oss<<static_cast<unsigned int>(mem_status.used_mem/1024)<<"/"<<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";
|
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 )
|
if( use_colors )
|
||||||
|
Loading…
Reference in New Issue
Block a user