feat: add kernel ACPI support for querying battery percentage, add battery indicator to desktop, move log state to 0:/state directory

This commit is contained in:
daniel committed 2026-09-11 07:11:48 +02:00
1 parent 0a18b2cf2d
commit e641500b40
34 files changed
+2461 -100

No files matched your search

+7
View File
@@ -639,6 +639,13 @@ namespace montauk {
return (int)syscall1(montauk::abi::SYS_BTINFO, (uint64_t)buf);
}
// ACPI battery status. Returns 0 on success, or -1 on a machine with no
// battery device at all -- which is the signal not to draw an indicator.
// A laptop with the pack removed still returns 0, with present == 0.
inline int battery_info(montauk::abi::BatteryInfo* out) {
return (int)syscall1(montauk::abi::SYS_BATTERYINFO, (uint64_t)out);
}
// Wi-Fi. scan() runs a full channel sweep and blocks until it finishes or
// timeoutMs elapses, then fills buf with the networks seen; it returns the
// number of entries written, or -1 when no adapter is ready.