mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-03 03:41:04 +01:00
refactored project structure
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include "fastfetch.h"
|
||||
|
||||
void ffPrintOS(FFstate* state)
|
||||
{
|
||||
if(ffPrintCachedValue(state, "OS"))
|
||||
return;
|
||||
|
||||
char name[256];
|
||||
ffParsePropFile("/etc/os-release", "NAME=\"%[^\"]+", name);
|
||||
if(name[0] == '\0')
|
||||
{
|
||||
ffPrintError(state, "OS", "\"NAME=\\\"%[^\\\"]+\" not found in \"/etc/os-release\"");
|
||||
return;
|
||||
}
|
||||
|
||||
char os[1024];
|
||||
sprintf(os, "%s %s", name, state->utsname.machine);
|
||||
|
||||
ffPrintAndSaveCachedValue(state, "OS", os);
|
||||
}
|
||||
Reference in New Issue
Block a user