mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-07 21:50:08 +01:00
--os-format
This commit is contained in:
+4
-2
@@ -7,7 +7,7 @@ void ffPrintOS(FFinstance* instance)
|
||||
|
||||
char name[256];
|
||||
ffParsePropFile("/etc/os-release", "NAME=\"%[^\"]+", name);
|
||||
if(name[0] == '\0')
|
||||
if(name[0] == '\0' && instance->config.osFormat[0] == '\0') //With custom format string we pass an empty string as name
|
||||
{
|
||||
ffPrintError(instance, "OS", "\"NAME=\\\"%[^\\\"]+\" not found in \"/etc/os-release\"");
|
||||
return;
|
||||
@@ -15,7 +15,9 @@ void ffPrintOS(FFinstance* instance)
|
||||
|
||||
char os[1024];
|
||||
|
||||
if(instance->config.osShowArchitecture)
|
||||
if(instance->config.osFormat[0] != '\0')
|
||||
sprintf(os, instance->config.osFormat, name, instance->state.utsname.machine);
|
||||
else if(instance->config.osShowArchitecture)
|
||||
sprintf(os, "%s %s", name, instance->state.utsname.machine);
|
||||
else
|
||||
strcpy(os, name);
|
||||
|
||||
Reference in New Issue
Block a user