diff --git a/src/logo/linux.c b/src/logo/linux.c index 0e2545f..e3a39c9 100644 --- a/src/logo/linux.c +++ b/src/logo/linux.c @@ -397,7 +397,7 @@ void getDistro(const char *distroname) { for (int i = 9; i < minsize; i++) { LOGO_SMALL[i] = GREEN " " RESET; } - } else if (strncmp((char *)distroname, "opensuse", strlen("opensuse")) == 0) { + } else if (strncmp((char *)distroname, "ubuntu", strlen("ubuntu")) == 0) { color = RED; titlecolor = RED; logosize = 20; diff --git a/src/storage.c b/src/storage.c index 5500e93..f331603 100644 --- a/src/storage.c +++ b/src/storage.c @@ -2,28 +2,21 @@ #include "common.h" #include +#include const char *display_storage() { - const char *excode = run_command_s("LC_ALL=C zpool list 2>/dev/null || echo $?"); + const char *excode = run_command_s("zpool list 2>/dev/null || echo $?"); + if ( + excode != NULL && (strncmp(excode, "127", strlen("127")) == 0)) { + free((void *)excode); + return run_command_s("df -h | " + "awk '/^\\/dev\\// {printf \"%s: %s / %s, \", $1, $3, $2}' | " + "awk '{sub(/, $/, \"\"); print}'"); + } else { - if (excode != NULL && strcmp(excode, "127") == 0) { - return run_command_s("df -h | " - "awk '/^\\/dev\\// {printf \"%s: %s / %s, \", $1, $3, $2}' | " - "awk '{sub(/, $/, \"\"); print}'"); - } else { - const char *iszfs = run_command_s("LC_ALL=C zpool list 2>&1"); - if ( - strncmp(iszfs, "sh: zpool: not found", strlen("sh: zpool: not found")) == 0 || - strncmp(iszfs, "sh: 1: zpool: not found", strlen("sh: 1: zpool: not found")) == 0 - ) { - return run_command_s("df -h | " - "awk '/^\\/dev\\// {printf \"%s: %s / %s, \", $1, $3, $2}' | " - "awk '{sub(/, $/, \"\"); print}'"); - } else { - return run_command_s("zpool list | " - "awk 'NR>1 {printf \"%s: %s / %s, \", $1, $3, $2}' | " - "awk '{sub(/, $/, \"\"); print}'"); - } - } + free((void *)excode); + return run_command_s("zpool list | " + "awk 'NR>1 {printf \"%s: %s / %s, \", $1, $3, $2}' | " + "awk '{sub(/, $/, \"\"); print}'"); + } } -