mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Battery (Haiku): add stub file
This commit is contained in:
+1
-1
@@ -1123,7 +1123,7 @@ elseif(Haiku)
|
||||
src/common/netif/netif_haiku.c
|
||||
src/common/networking_linux.c
|
||||
src/common/processing_linux.c
|
||||
src/detection/battery/battery_nosupport.c
|
||||
src/detection/battery/battery_haiku.c
|
||||
src/detection/bios/bios_nosupport.c
|
||||
src/detection/board/board_nosupport.c
|
||||
src/detection/bootmgr/bootmgr_nosupport.c
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#include "fastfetch.h"
|
||||
#include "battery.h"
|
||||
#include "common/io/io.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
void parseBattery(FFstrbuf* content, FFlist* results)
|
||||
{
|
||||
char* line = NULL;
|
||||
size_t n = 0;
|
||||
while (ffStrbufGetline(&line, &n, content))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const char* ffDetectBattery(FFBatteryOptions* options, FFlist* results)
|
||||
{
|
||||
FF_AUTO_CLOSE_DIR DIR* dir = opendir("/dev/power/acpi_battery/");
|
||||
if (!dir) return "opendir(/dev/power/acpi_battery) failed";
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY content = ffStrbufCreate();
|
||||
struct dirent* entry;
|
||||
while ((entry = readdir(dir)))
|
||||
{
|
||||
if (entry->d_name[0] == '.') continue;
|
||||
if (!ffReadFileBufferRelative(dirfd(dir), entry->d_name, &content)) continue;
|
||||
parseBattery(&content, results);
|
||||
}
|
||||
|
||||
return "To be supported";
|
||||
}
|
||||
Reference in New Issue
Block a user