on_ac_power(1)

on_ac_power1

Test whether computer is running on ac power

Usage

on_ac_power

Overview

on_ac_power checks whether the system is running on abundant power (such as AC mains, an USB charger, etc), as opposed to battery power.

Options

None.

Exit status

0 (true)	System is on mains power
1 (false)	System is not on mains power
255 (false)	Power status could not be determined

Caveats

The vast majority of desktops and servers have no power sensors, thus they return 255 "unknown"; for most purposes you'd want to consider this answer to imply mains power — note that 255 evaluates as false for the shell.

This program currently provides only information known to the kernel; it doesn't (yet?) query userspace daemons such as nut which may provide further information.

Releases

12 releases since Debian 3.0 (Woody); the text changed 1 time.

  1. 3.0–9
  2. 10–13

Author

This manual page was written by Steve Dodd <[email protected]>, was updated by Thomas Hood then by Adam Borowski.

From powermgmt-base 1.38 in Debian 13 (Trixie). Parsed by carta from the page's man source.