Skip to content

aos power

Power source detection and keep-awake

4 commands. Run aos power --help for the same list from the binary, or see every group.

Whether the machine runs on mains power or battery. For charge level, see battery. awake keeps the machine from sleeping, for --for=2h or until aos power awake off; --display keeps the screen on too. It is held by a small child process (caffeinate, systemd-inhibit, or aos itself on Windows), so a crash or reboot never leaves the machine stuck awake.

Keep the machine from sleeping, for a while or until power awake off

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos power awake [--for=<duration>] [--display] [--json]
flag values meaning
--for <duration> Optional
--display Optional
--json Optional
Terminal window
aos power awake --for=2h
aos power awake --for=30m --display
aos power awake # until `aos power awake off`

End the keep-awake started by power awake

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos power awake off
Terminal window
aos power awake off

Print whether a keep-awake is active and until when

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos power awake status [--json]
flag values meaning
--json Optional
Terminal window
aos power awake status
aos power awake status --json

Print the current power source (ac or battery)

Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works

Terminal window
aos power status
Terminal window
aos power status