apm_get_power_status(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to apm_get_power_status(9) from the Kernel API Manual β€” the little kernel API page about grabbing the current power state. no cap, it's giving hardware gossip and I'm obsessed. πŸ’–

🌸 NAME 🌸

apm_get_power_status β€” get current power state

✨ SYNOPSIS ✨

int apm_get_power_status (u_short *status , u_short *bat , u_short *life );

that's the signature, bestie: it returns an int and takes three pointers to u_short. the way that C just loves a pointer... πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • status β€” returned status. that's the assignment, periodt.
  • bat β€” battery info. iconic.
  • life β€” estimated life. we love an estimate.

πŸ’– DESCRIPTION πŸ’–

okay so this one obtains the current power status from the APM BIOS. (yes, APM BIOS β€” we are in kernel-land, bestie.) We return a status that gives the rough battery status and the current power source. The returned bat value gives an estimate as a percentage of life and a status value for the battery. The estimated life, if it's reported, is a lifetime in seconds/minutes at current power consumption. literally all the power tea. πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page, bestie! πŸŽ€ the footer tells us source ./arch/x86/kernel, date October 2026, and manpage apm_get_power_status(9). mwah πŸ’‹

πŸ“¦ where this page comes from