diff --git a/CHANGELOG.md b/CHANGELOG.md index 83883afcb..041f0f97f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ Changes: Features: * Add `--key-width` for aligning the left edge of values +Bugfixes: +* Fix label detection (Disk, Linux) + # 2.0.0-beta Fastfetch v2 introduces a new configuration file format: JSON config. Please refer to for details. diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index afde1887e..424107331 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -122,20 +122,16 @@ static void detectName(FFDisk* disk, const FFstrbuf* device) FF_STRBUF_AUTO_DESTROY basePath = ffStrbufCreate(); - //Try partlabel first - ffStrbufSetS(&basePath, "/dev/disk/by-partlabel/"); + //Try label first + ffStrbufSetS(&basePath, "/dev/disk/by-label/"); detectNameFromPath(disk, &deviceStat, &basePath); - //Try label second if(disk->name.length == 0) { - ffStrbufSetS(&basePath, "/dev/disk/by-label/"); + //Try partlabel second + ffStrbufSetS(&basePath, "/dev/disk/by-partlabel/"); detectNameFromPath(disk, &deviceStat, &basePath); } - - //Use the mountpoint as a last resort - if(disk->name.length == 0) - ffStrbufAppend(&disk->name, &disk->mountpoint); } #ifdef __ANDROID__ diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index 151596c27..8346f38a4 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -34,8 +34,9 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk) } else { - ffParseFormatString(&key, &options->moduleArgs.key, 1, (FFformatarg[]){ - {FF_FORMAT_ARG_TYPE_STRBUF, &disk->mountpoint} + ffParseFormatString(&key, &options->moduleArgs.key, 2, (FFformatarg[]){ + {FF_FORMAT_ARG_TYPE_STRBUF, &disk->mountpoint}, + {FF_FORMAT_ARG_TYPE_STRBUF, &disk->name}, }); }