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
#include "swap.h"

#include <mach/mach.h>
#include <sys/sysctl.h>

const char* ffDetectSwap(FFSwapResult* swap)
{
    struct xsw_usage xsw;
    size_t size = sizeof(xsw);
    if(sysctl((int[]){ CTL_VM, VM_SWAPUSAGE }, 2, &xsw, &size, NULL, 0) != 0)
        return "Failed to read vm.swapusage";

    swap->bytesTotal = xsw.xsu_total;
    swap->bytesUsed = xsw.xsu_used;
    return NULL;
}