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

@ -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;
}
}