From c44bd6dbc141f4ec71d5d6ba6653f7279f153d78 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Sun, 28 Mar 2021 15:38:52 +0200 Subject: [PATCH] better disk output --- completions/bash | 1 + src/common.c | 4 +++ src/fastfetch.c | 6 +++- src/fastfetch.h | 2 ++ src/modules/cpu.c | 1 - src/modules/disk.c | 82 +++++++++++++++++++++++++++++++++++++-------- src/util/FFstrbuf.c | 10 ++++++ src/util/FFstrbuf.h | 1 + 8 files changed, 91 insertions(+), 16 deletions(-) diff --git a/completions/bash b/completions/bash index 0c99f83e8..f21c14ffc 100644 --- a/completions/bash +++ b/completions/bash @@ -146,6 +146,7 @@ __fastfetch_completion() "--disk-format" "--battery-format" "--locale-format" + "--disk-folders" ) local FF_OPTIONS_PATH=( diff --git a/src/common.c b/src/common.c index 987c48512..62cbc1919 100644 --- a/src/common.c +++ b/src/common.c @@ -56,6 +56,8 @@ void ffDefaultConfig(FFconfig* config) ffStrbufInitA(&config->libPCI, 256); ffStrbufInitA(&config->libX11, 256); ffStrbufInitA(&config->libXrandr, 256); + + ffStrbufInitA(&config->diskFolders, 128); } static void ffCleanup(FFinstance* instance) @@ -88,6 +90,8 @@ static void ffCleanup(FFinstance* instance) ffStrbufDestroy(&instance->config.libX11); ffStrbufDestroy(&instance->config.libXrandr); + ffStrbufDestroy(&instance->config.diskFolders); + ffStrbufDestroy(&instance->state.terminal.value); } diff --git a/src/fastfetch.c b/src/fastfetch.c index 48666c036..a63a75f94 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -84,6 +84,8 @@ static inline void printHelp() " --lib-PCI \n" " --lib-X11 \n" " --lib-Xrandr \n" + "Module specific options:\n" + " --disk-folders : A colon seperated list of folder paths for the disk output. Default is \"/:/home\"\n" "\n" "If an value starts with an ?, it is optional. \"true\" will be used if not set.\n" "An (+) at the end indicates that more help can be printed with --help