diff options
| author | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
|---|---|---|
| committer | sumuel <samuel@yakubos.org> | 2026-08-17 20:44:55 +0000 |
| commit | 76424950e373d3b04ac3dd13019151bfba3e8423 (patch) | |
| tree | 4c3cfdbda039e592b9186be3e28f8d7cfd439e8a /src/detection/battery/battery.h | |
Add the files
Diffstat (limited to 'src/detection/battery/battery.h')
| -rw-r--r-- | src/detection/battery/battery.h | 32 |
1 files changed, 32 insertions, 0 deletions
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); |