diff --git a/CHANGELOG.md b/CHANGELOG.md index caeb3e0d9..44402b68a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Features: * Add `--list-data-paths` option which list search paths for presets and logos * Add `Brightness` module support * Add `Battery` module support for FreeBSD +* Add `--disk-show-unknown` option for Disk module Logos: * Raspbian (@IamNoRobot, #373) diff --git a/src/common/init.c b/src/common/init.c index 59aee5fb1..c333e03b6 100644 --- a/src/common/init.c +++ b/src/common/init.c @@ -320,6 +320,7 @@ static void defaultConfig(FFinstance* instance) ffStrbufInitA(&instance->config.diskFolders, 0); instance->config.diskShowRemovable = true; instance->config.diskShowHidden = false; + instance->config.diskShowUnknown = false; ffStrbufInitA(&instance->config.batteryDir, 0); diff --git a/src/data/config_user.txt b/src/data/config_user.txt index 2afeba65e..d2faddb78 100644 --- a/src/data/config_user.txt +++ b/src/data/config_user.txt @@ -212,6 +212,31 @@ # Default is auto. #--gl auto +# Disk option +# Sets if removable volume should be printed +# Must be either true or false +# Default is true. +#--disk-show-removable true + +# Disk option +# Sets if hidden volume should be printed +# Must be either true or false +# Default is false. +#--disk-show-hidden false + +# Disk option +# Sets if unknown (unable to detect sizes) volume should be printed +# Must be either true or false +# Default is false. +#--disk-show-unknown false + +# Disk option +# A colon (semicolon on Windows) separated list of folder paths for the disk output +# This option override `--disk-show-*` options above +# Must be a string +# Default is "/:/home" ("C:\\;D:\\ ..." on Windows). +#--disk-folders /:/home + # Percentage output type option # Applies to all modules that prints percentage values. Currently memory, swap, disk, battery and CPU usage are supported. # Only works with default format ( without --module-format option ). diff --git a/src/data/help.txt b/src/data/help.txt index 6b6d39aea..5fb36821a 100644 --- a/src/data/help.txt +++ b/src/data/help.txt @@ -106,6 +106,7 @@ Module specific options: --disk-folders : A colon (semicolon on Windows) separated list of folder paths for the disk output. Default is "/:/home" ("C:\\;D:\\ ..." on Windows) --disk-show-removable : Set if removable volume should be printed. Default is true --disk-show-hidden : Set if hidden volumes should be printed. Default is false + --disk-show-unknown : Set if unknown (unable to detect sizes) volumes should be printed. Default is false --battery-dir : The directory where the battery folders are. Standard: /sys/class/power_supply/ --cpu-temp : Detect and display CPU temperature if supported. Default is false --gpu-temp : Detect and display GPU temperature if supported. Default is false diff --git a/src/fastfetch.c b/src/fastfetch.c index ad63f26a3..62935fc73 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -1254,6 +1254,8 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con instance->config.diskShowRemovable = optionParseBoolean(value); else if(strcasecmp(key, "--disk-show-hidden") == 0) instance->config.diskShowHidden = optionParseBoolean(value); + else if(strcasecmp(key, "--disk-show-unknown") == 0) + instance->config.diskShowUnknown = optionParseBoolean(value); else if(strcasecmp(key, "--battery-dir") == 0) optionParseString(key, value, &instance->config.batteryDir); else if(strcasecmp(key, "--separator-string") == 0) diff --git a/src/fastfetch.h b/src/fastfetch.h index 0572ef294..e215d3e3f 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -180,6 +180,7 @@ typedef struct FFconfig FFstrbuf diskFolders; bool diskShowRemovable; bool diskShowHidden; + bool diskShowUnknown; FFstrbuf batteryDir; diff --git a/src/modules/disk.c b/src/modules/disk.c index eb6baeb47..ba07fb823 100644 --- a/src/modules/disk.c +++ b/src/modules/disk.c @@ -135,6 +135,9 @@ static void printAutodetected(FFinstance* instance, const FFlist* disks) if(disk->type == FF_DISK_TYPE_HIDDEN && !instance->config.diskShowHidden) continue; + if(disk->bytesTotal == 0 && !instance->config.diskShowUnknown) + continue; + printDisk(instance, disk); } }