mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Top: adds option showType: <cpu|mem|disk>
This commit is contained in:
@@ -114,8 +114,11 @@ void ffPrepareCommandOption(FFdata* data) {
|
||||
#if !FF_MODULE_DISABLE_TOP
|
||||
case 'T':
|
||||
case 't':
|
||||
FF_IF_MODULE_MATCH(ffTopModuleInfo.name)
|
||||
ffPrepareTopProcesses();
|
||||
FF_IF_MODULE_MATCH(ffTopModuleInfo.name) {
|
||||
[[gnu::cleanup(ffDestroyTopOptions)]] FFTopOptions options;
|
||||
ffInitTopOptions(&options);
|
||||
ffPrepareTopProcesses(options.showTypes);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -199,7 +199,12 @@ static void prepareModuleJsonObject(const char* type, yyjson_val* module) {
|
||||
case 't':
|
||||
case 'T': {
|
||||
if (ffStrEqualsIgnCase(type, ffTopModuleInfo.name)) {
|
||||
ffPrepareTopProcesses();
|
||||
[[gnu::cleanup(ffDestroyTopOptions)]] FFTopOptions options;
|
||||
ffInitTopOptions(&options);
|
||||
if (module) {
|
||||
ffTopModuleInfo.parseJsonObject(&options, module);
|
||||
}
|
||||
ffPrepareTopProcesses(options.showTypes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user