Fastfetch: revert to module color after printing custom colors

This commit is contained in:
李通洲
2024-05-08 15:25:59 +08:00
parent 2880536513
commit 459f159b1b
16 changed files with 67 additions and 47 deletions
+4 -4
View File
@@ -60,7 +60,7 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
{
if(instance.config.display.percentType & FF_PERCENTAGE_TYPE_BAR_BIT)
{
ffPercentAppendBar(&str, bytesPercentage, options->percent);
ffPercentAppendBar(&str, bytesPercentage, options->percent, &options->moduleArgs);
ffStrbufAppendC(&str, ' ');
}
@@ -69,7 +69,7 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
if(instance.config.display.percentType & FF_PERCENTAGE_TYPE_NUM_BIT)
{
ffPercentAppendNum(&str, bytesPercentage, options->percent, str.length > 0);
ffPercentAppendNum(&str, bytesPercentage, options->percent, str.length > 0, &options->moduleArgs);
ffStrbufAppendC(&str, ' ');
}
}
@@ -105,10 +105,10 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk)
else
{
FF_STRBUF_AUTO_DESTROY bytesPercentageStr = ffStrbufCreate();
ffPercentAppendNum(&bytesPercentageStr, bytesPercentage, options->percent, false);
ffPercentAppendNum(&bytesPercentageStr, bytesPercentage, options->percent, false, &options->moduleArgs);
FF_STRBUF_AUTO_DESTROY filesPercentageStr = ffStrbufCreate();
double filesPercentage = disk->filesTotal > 0 ? ((double) disk->filesUsed / (double) disk->filesTotal) * 100.0 : 0;
ffPercentAppendNum(&filesPercentageStr, filesPercentage, options->percent, false);
ffPercentAppendNum(&filesPercentageStr, filesPercentage, options->percent, false, &options->moduleArgs);
bool isExternal = !!(disk->type & FF_DISK_VOLUME_TYPE_EXTERNAL_BIT);
bool isHidden = !!(disk->type & FF_DISK_VOLUME_TYPE_HIDDEN_BIT);