mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Disk: add --disk-show-unknown option
Ref: https://github.com/LinusDierheimer/fastfetch/issues/383#issuecomment-1376893128
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 ).
|
||||
|
||||
@@ -106,6 +106,7 @@ Module specific options:
|
||||
--disk-folders <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 <?value>: Set if removable volume should be printed. Default is true
|
||||
--disk-show-hidden <?value>: Set if hidden volumes should be printed. Default is false
|
||||
--disk-show-unknown <?value>: Set if unknown (unable to detect sizes) volumes should be printed. Default is false
|
||||
--battery-dir <folder>: The directory where the battery folders are. Standard: /sys/class/power_supply/
|
||||
--cpu-temp <?value>: Detect and display CPU temperature if supported. Default is false
|
||||
--gpu-temp <?value>: Detect and display GPU temperature if supported. Default is false
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -180,6 +180,7 @@ typedef struct FFconfig
|
||||
FFstrbuf diskFolders;
|
||||
bool diskShowRemovable;
|
||||
bool diskShowHidden;
|
||||
bool diskShowUnknown;
|
||||
|
||||
FFstrbuf batteryDir;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user