@@ -73,8 +73,9 @@ namespace Config {
7373
7474 {" presets" , " #* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.\n "
7575 " #* Format: \" box_name:P:G,box_name:P:G\" P=(0 or 1) for alternate positions, G=graph symbol to use for box.\n "
76+ " #* proc box format can also be \" proc:P:G:W\" W=(0-100) for proc width percentage.\n "
7677 " #* Use whitespace \" \" as separator between different presets.\n "
77- " #* Example: \" cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty\" " },
78+ " #* Example: \" cpu:0:default,mem:0:tty,proc:1:default:80 cpu:0:braille,proc:0:tty\" " },
7879
7980 {" vim_keys" , " #* Set to True to enable \" h,j,k,l,g,G\" keys for directional control in lists.\n "
8081 " #* Conflicting keys for h:\" help\" and k:\" kill\" is accessible while holding shift." },
@@ -468,7 +469,7 @@ namespace Config {
468469 return false ;
469470 }
470471 const auto & vals = ssplit (box, ' :' );
471- if (vals.size () != 3 ) {
472+ if (vals.size () != 3 and not (vals. size () == 4 and vals. at ( 0 ) == " proc " ) ) {
472473 validError = " Malformatted preset in config value presets!" ;
473474 return false ;
474475 }
@@ -484,6 +485,10 @@ namespace Config {
484485 validError = " Invalid graph name in config value presets!" ;
485486 return false ;
486487 }
488+ if (vals.size () == 4 and not (vals.at (3 ) == " default" or intValid (" " , vals.at (3 )))) {
489+ validError = " Invalid proc width percent in config value presets!" ;
490+ return false ;
491+ }
487492 }
488493 new_presets.push_back (preset);
489494 }
@@ -515,6 +520,7 @@ namespace Config {
515520 set (" mem_below_net" , (vals.at (1 ) != " 0" ));
516521 } else if (vals.at (0 ) == " proc" ) {
517522 set (" proc_left" , (vals.at (1 ) != " 0" ));
523+ set (" proc_box_width_percent" , (vals.size () == 4 and vals.at (3 ) != " default" ) ? std::clamp (stoi (vals.at (3 )), 0 , 100 ) : Proc::width_p);
518524 }
519525 if (vals.at (0 ).starts_with (" gpu" )) {
520526 set (" graph_symbol_gpu" , vals.at (2 ));
0 commit comments