From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/detection/battery/battery.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/detection/battery/battery.h (limited to 'src/detection/battery/battery.h') diff --git a/src/detection/battery/battery.h b/src/detection/battery/battery.h new file mode 100644 index 0000000..1a3b4e9 --- /dev/null +++ b/src/detection/battery/battery.h @@ -0,0 +1,32 @@ +#pragma once + +#include "fastfetch.h" +#include "modules/battery/option.h" + +#define FF_BATTERY_TEMP_UNSET (-DBL_MAX) + +typedef enum FFBatteryStatus { + FF_BATTERY_STATUS_NONE = 0, + FF_BATTERY_STATUS_UNKNOWN = 1 << 0, + FF_BATTERY_STATUS_AC_CONNECTED = 1 << 1, + FF_BATTERY_STATUS_USB_CONNECTED = 1 << 2, + FF_BATTERY_STATUS_WIRELESS_CONNECTED = 1 << 3, + FF_BATTERY_STATUS_CHARGING = 1 << 4, + FF_BATTERY_STATUS_DISCHARGING = 1 << 5, + FF_BATTERY_STATUS_CRITICAL = 1 << 6, +} FFBatteryStatus; + +typedef struct FFBatteryResult { + FFstrbuf manufacturer; + FFstrbuf manufactureDate; + FFstrbuf modelName; + FFstrbuf technology; + FFstrbuf serial; + FFBatteryStatus status; + double capacity; + double temperature; + uint32_t cycleCount; + int32_t timeRemaining; // in seconds, -1 if unknown +} FFBatteryResult; + +const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results); -- cgit v1.2.3