{
    "mode": "man",
    "parameter": "ON_AC_POWER",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ON_AC_POWER/1/json",
    "generated": "2026-06-13T21:55:36Z",
    "synopsis": "onacpower",
    "sections": {
        "NAME": {
            "content": "onacpower - test whether computer is running on AC power\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "onacpower\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "onacpower  checks whether the system is running on abundant power (such as AC mains, an USB\ncharger, etc), as opposed to battery power.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "None.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "",
            "subsections": [
                {
                    "name": "0 (true)",
                    "content": ""
                },
                {
                    "name": "1 (false)",
                    "content": ""
                },
                {
                    "name": "255 (false)",
                    "content": ""
                }
            ]
        },
        "CAVEATS": {
            "content": "The vast majority of desktops and servers have no power sensors, thus they  return  255  \"un‐\nknown\"; for most purposes you'd want to consider this answer to imply mains power — note that\n255 evaluates as false for the shell.\n\nThis program currently provides only information known to the kernel; it doesn't (yet?) query\nuserspace daemons such as nut which may provide further information.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "This  manual  page was written by Steve Dodd <steved@loth.demon.co.uk>, was updated by Thomas\nHood then by Adam Borowski.\n\n\n\n12 March 2018                             ONACPOWER(1)",
            "subsections": []
        }
    },
    "summary": "onacpower - test whether computer is running on AC power",
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "A simple utility which tests if a computer is running on line power.",
        "examples": [
            {
                "description": "Test if a computer is running on line power",
                "command": "on_ac_power"
            }
        ]
    }
}