mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-01 18:42:56 +01:00
@@ -1,7 +1,7 @@
|
||||
#include "swap.h"
|
||||
|
||||
#include "common/sysctl.h"
|
||||
#include <mach/mach.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
const char* ffDetectSwap(FFlist* result) {
|
||||
struct xsw_usage xsw;
|
||||
@@ -10,6 +10,12 @@ const char* ffDetectSwap(FFlist* result) {
|
||||
return "Failed to read vm.swapusage";
|
||||
}
|
||||
|
||||
if (xsw.xsu_total == 0) {
|
||||
if (ffSysctlGetInt("vm.compressor_mode", 4) <= 2) {
|
||||
return NULL; // Swap is disabled
|
||||
}
|
||||
}
|
||||
|
||||
FFSwapResult* swap = ffListAdd(result);
|
||||
ffStrbufInitStatic(&swap->name, xsw.xsu_encrypted ? "Encrypted" : "Normal");
|
||||
swap->bytesTotal = xsw.xsu_total;
|
||||
|
||||
Reference in New Issue
Block a user