ON_AC_POWER(1)

๐Ÿ“ฆ
version 1.39ubuntu1 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ ON_AC_POWER(1) โ€” on_ac_power ๐Ÿ”Œ โœจ

๐Ÿ’– NAME

on_ac_power - test whether computer is running on AC power

๐ŸŽ€ SYNOPSIS

on_ac_power

๐Ÿฆ‹ DESCRIPTION

okay so on_ac_power is literally the vibe check for your power supply ๐Ÿ”‹โœจ It checks whether the system is running on abundant power (like AC mains, a USB charger, etc.) instead of battery power. no cap, it's giving plugged-in energy ๐Ÿ”Œ๐Ÿ’…

๐ŸŒธ OPTIONS

None. ๐Ÿ™ˆ it really doesn't need any, it's already iconic as-is ๐Ÿ‘‘

๐Ÿงš EXIT STATUS

  • 0 (true) โ€” System is on mains power โšก plugged in and thriving ๐Ÿ’–
  • 1 (false) โ€” System is not on mains power ๐Ÿ”‹ running on battery, bestie
  • 255 (false) โ€” Power status could not be determined ๐Ÿ’€ the system just shrugged

๐Ÿ’œ CAVEATS

โš ๏ธ okay listen bestie, most desktops and servers have no power sensors, so they return 255 "unknown" ๐Ÿ˜ญ for most purposes you'd want to treat this answer as implying mains power ๐Ÿ”Œ โ€” just note that 255 evaluates as false for the shell, so don't let that trip you up ๐Ÿ™ˆ

ngl this one's lowkey important: the program currently provides only information known to the kernel ๐Ÿง  it doesn't (yet?) query userspace daemons such as nut which may provide further information ๐ŸŒˆ

๐Ÿซถ AUTHOR

This manual page was written by Steve Dodd <steved@loth.demon.co.uk>, was updated by Thomas Hood then by Adam Borowski. ๐Ÿ’œ all the legends who made this page slay โœจ


๐ŸŒˆ ok that's the tea, bestie! manual page from 12 March 2018 โ€” ON_AC_POWER(1) โ€” stay plugged in and stay iconic ๐Ÿ”Œ๐Ÿ’…โœจ