mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Disk: add missing JSON config options
This commit is contained in:
@@ -2100,6 +2100,11 @@
|
||||
"type": "string",
|
||||
"description": "A colon separated file systems to hide from the disk output"
|
||||
},
|
||||
"showRegular": {
|
||||
"type": "boolean",
|
||||
"description": "Set if regular volume should be printed",
|
||||
"default": true
|
||||
},
|
||||
"showExternal": {
|
||||
"type": "boolean",
|
||||
"description": "Set if external volume should be printed",
|
||||
|
||||
@@ -324,6 +324,15 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unsafe_yyjson_equals_str(key, "showRegular"))
|
||||
{
|
||||
if (yyjson_get_bool(val))
|
||||
options->showTypes |= FF_DISK_VOLUME_TYPE_REGULAR_BIT;
|
||||
else
|
||||
options->showTypes &= ~FF_DISK_VOLUME_TYPE_REGULAR_BIT;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (unsafe_yyjson_equals_str(key, "showExternal"))
|
||||
{
|
||||
if (yyjson_get_bool(val))
|
||||
@@ -394,6 +403,9 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso
|
||||
|
||||
if (defaultOptions.showTypes != options->showTypes)
|
||||
{
|
||||
if (options->showTypes & FF_DISK_VOLUME_TYPE_REGULAR_BIT)
|
||||
yyjson_mut_obj_add_bool(doc, module, "showRegular", true);
|
||||
|
||||
if (options->showTypes & FF_DISK_VOLUME_TYPE_EXTERNAL_BIT)
|
||||
yyjson_mut_obj_add_bool(doc, module, "showExternal", true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user