is_ext_pwr_online(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– is_ext_pwr_online(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” this one is short and sweet and honestly kind of a vibe check for your battery's external power situation πŸ”Œβœ¨


🌸 SYNOPSIS 🌸

bool is_ext_pwr_online (struct charger_manager *cm );

πŸŽ€ ARGUMENTS πŸŽ€

  • cm β€” the Charger Manager representing the battery, aka the main character of this whole little situation πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

So this function returns true if at least one of the chargers of the battery has an external power source attached to charge the battery. And the important little detail? It doesn't care whether it is actually charging or not β€” just whether that external source is attached, periodt πŸ’…βœ¨

Like, the charger is plugged in, bestie. Whether the battery is actively sipping that power is a whole separate question πŸ˜ŒπŸ”‹


🌈 SEE ALSO 🌈

Kernel file ./drivers/power/supply/charger-manager.c and its whole friend group:


and that's the whole page, no cap 🫢 this little icon came from ./drivers/power/supply, dated October 2026 β€” slay, stay charged, and go read the whole charger-manager friend group when you're done here πŸ’–πŸ”‹βœ¨

πŸ“¦ where this page comes from