logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

on_ac_power - test whether computer is running on AC power

Author

       This manual page was written by Steve Dodd <steved@loth.demon.co.uk>, was updated by Thomas Hood then  by
       Adam Borowski.

                                                  12 March 2018                                   ON_AC_POWER(1)

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.

Description

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.

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

Name

       on_ac_power - test whether computer is running on AC power

Options

       None.

Synopsis

on_ac_power

See Also