Files
fastfetch/src/os.c
T

16 lines
412 B
C
Raw Normal View History

2021-02-18 22:25:36 +01:00
#include "fastfetch.h"
void ffPrintOS(FFstate* state)
{
char name[256];
2021-02-19 16:23:41 +01:00
ffParsePropFile("/etc/os-release", "NAME=\"%[^\"]+", name);
if(name[0] == '\0')
2021-02-18 22:25:36 +01:00
{
2021-02-19 16:23:41 +01:00
if(state->showErrors)
ffPrintError(state, "OS", "\"NAME=\\\"%[^\\\"]+\" not found in \"/etc/os-release\"");
return;
2021-02-18 22:25:36 +01:00
}
ffPrintLogoAndKey(state, "OS");
printf("%s %s\n", name, state->utsname.machine);
}