man-pages/man1/on_ac_power.1.html
2021-03-31 01:06:50 +01:00

87 lines
2.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of ON_AC_POWER</TITLE>
</HEAD><BODY>
<H1>ON_AC_POWER</H1>
Section: User Commands (1)<BR>Updated: 12 March 2018<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
on_ac_power - test whether computer is running on AC power
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>on_ac_power</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>on_ac_power</B>
checks whether the system is running on abundant power (such as AC mains,
an USB charger, etc), as opposed to battery power.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
None.
<A NAME="lbAF">&nbsp;</A>
<H2>EXIT STATUS</H2>
<BR>
<PRE>
<B>0</B> (true) System is on mains power
<B>1</B> (false) System is not on mains power
<B>255</B> (false) Power status could not be determined
</PRE><A NAME="lbAG">&nbsp;</A>
<H2>CAVEATS</H2>
The vast majority of desktops and servers have no power sensors, thus
they return 255 &quot;unknown&quot;; for most purposes you'd want to consider
this answer to imply mains power --- note that 255 evaluates as false
for the shell.
<P>
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.
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>
This manual page was written by Steve Dodd &lt;<A HREF="mailto:steved@loth.demon.co.uk">steved@loth.demon.co.uk</A>&gt;,
was updated by Thomas Hood then by Adam Borowski.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="5"><A HREF="#lbAF">EXIT STATUS</A><DD>
<DT id="6"><A HREF="#lbAG">CAVEATS</A><DD>
<DT id="7"><A HREF="#lbAH">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:20 GMT, March 31, 2021
</BODY>
</HTML>