SYSTEMD-AC-POWER(1) systemd-ac-power SYSTEMD-AC-POWER(1)
systemd-ac-power - Report whether we are connected to an external power source
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)).
The following options are understood: -v, --verbose Show result as text instead of just returning success or failure. --low 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 otherwise. -h, --help Print a short help text and exit. --version Print a short version string and exit.
On success (running on AC power), 0 is returned, a non-zero failure code otherwise.
This page is part of the systemd (systemd system and service manager) project. Information about the project can be found at ⟨http://www.freedesktop.org/wiki/Software/systemd⟩. If you have a bug report for this manual page, see ⟨http://www.freedesktop.org/wiki/Software/systemd/#bugreports⟩. This page was obtained from the project's upstream Git repository ⟨https://github.com/systemd/systemd.git⟩ 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 email@example.com systemd 253 SYSTEMD-AC-POWER(1)
Pages that refer to this page: systemd.directives(7), systemd.index(7)