systemd-ac-power(1) — Linux manual page


SYSTEMD-AC-POWER(1)         systemd-ac-power         SYSTEMD-AC-POWER(1)

NAME         top

       systemd-ac-power - Report whether we are connected to an external
       power source

SYNOPSIS         top

       systemd-ac-power [OPTIONS...]

DESCRIPTION         top

       systemd-ac-power may be used to check whether the system is
       running on AC power or not. By default it will simply return
       success (if we can detect that we are running on AC power) or
       failure, with no output. This can be useful for example to debug
       ConditionACPower= (see systemd.unit(5)).

OPTIONS         top

       The following options are understood:

       -v, --verbose
           Show result as text instead of just returning success or

           Instead of showing AC power state, show low battery state. In
           this case will return zero if all batteries are currently
           discharging and below 5% of maximum charge. Returns non-zero

       -h, --help
           Print a short help text and exit.

           Print a short version string and exit.

EXIT STATUS         top

       On success (running on AC power), 0 is returned, a non-zero
       failure code otherwise.

SEE ALSO         top


COLOPHON         top

       This page is part of the systemd (systemd system and service
       manager) project.  Information about the project can be found at
       ⟨⟩.  If you have
       a bug report for this manual page, see
       This page was obtained from the project's upstream Git repository
       ⟨⟩ on 2023-06-23.  (At that
       time, the date of the most recent commit that was found in the
       repository was 2023-06-23.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to

systemd 253                                          SYSTEMD-AC-POWER(1)

Pages that refer to this page: systemd.directives(7)systemd.index(7)