This commit is contained in:
Your Name 2023-11-26 13:13:38 +03:00
parent bbf0fd0aba
commit b88f882a17
3 changed files with 18 additions and 17 deletions

View File

@ -12,8 +12,9 @@
#define CLOCK CLOCK_MONOTONIC
#endif
#define OS_SIZE 128
typedef struct {
char os_name[128];
char os_name[OS_SIZE + 1];
struct utsname uts;
char *pkg_cmd;

View File

@ -32,13 +32,13 @@ char *Alpine[] = {
};
char *Arch[] = {
"\033[1;34m /\\ ",
"\033[1;34m / \\ ",
"\033[1;34m /\\ \\ ",
"\033[1;34m / \\ ",
"\033[1;34m / ,, \\ ",
"\033[1;34m / | | -\\ ",
"\033[1;34m/_-'' ''-_\\",
"\033[1;34m /\\ ",
"\033[1;34m / \\ ",
"\033[1;34m /\\ \\ ",
"\033[1;34m / \\ ",
"\033[1;34m / ,, \\ ",
"\033[1;34m / | | -\\ ",
"\033[1;34m/_-'' ''-_\\ ",
" "
};
@ -64,10 +64,12 @@ char *OpenBSD[] = {
};
char *PlainOs[] = {
" /U /U ",
"( . .) ",
"*(()()) ",
" "
" (\\(\\ ",
" j . .) ",
" | ° ! ",
" ? ; ",
" c?\".UJ ",
" "
};
char *Unknow[] = {

View File

@ -22,9 +22,6 @@ FETCH Init(void) {
if (GetOs(fetch.os_name, sizeof(fetch.os_name)))
snprintf(fetch.os_name, sizeof(fetch.os_name), "%s", fetch.uts.sysname);
else
snprintf(fetch.os_name, sizeof(fetch.os_name), "%s", fetch.os_name + strlen("NAME=\""));
fetch.font_color = FONT_COLOR;
GetArt(&fetch);
return fetch;
@ -36,10 +33,11 @@ int GetOs(char *os_name, size_t len) {
return 1;
while (fgets(os_name, len, fp)) {
if (!strncmp(os_name, "NAME=", 5)) {
if (!strncmp(os_name, "PRETTY_NAME=\"", 5)) {
os_name[strlen(os_name) - 2] = '\0';
fclose(fp);
snprintf(os_name, len, os_name + strlen("PRETTY_NAME=\""));
fclose(fp);
return 0;
}
}