fastfetch-sys 2.43.0

A neofetch like system information tool
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "os.h"
#include "common/io/io.h"

void ffDetectOSImpl(FFOSResult* os)
{
    if (!ffReadFileBuffer("/etc/release", &os->prettyName))
        return;

    ffStrbufSubstrBeforeFirstC(&os->prettyName, '\n');
    ffStrbufSubstrBeforeLastC(&os->prettyName, '(');
    ffStrbufTrim(&os->prettyName, ' ');

    // OpenIndiana Hipster 2024.04
    uint32_t idx = ffStrbufFirstIndexC(&os->prettyName, ' ');
    ffStrbufSetNS(&os->id, idx, os->prettyName.chars);
    ffStrbufSetStatic(&os->idLike, "sunos");
}