General
cancel
Showing results for 
Search instead for 
Did you mean: 

command that tells either notebook is on AC/DC power ?

SOLVED
Go to solution
Maaz
Valued Contributor

command that tells either notebook is on AC/DC power ?

is there any command that let us know that either the notebook is on AC or DC power ?

Regards
2 REPLIES
mike wagner_4
Occasional Advisor
Solution

Re: command that tells either notebook is on AC/DC power ?

Does a
cat /proc/acpi/ac_adapter/C1A2/state
help?

Maaz
Valued Contributor

Re: command that tells either notebook is on AC/DC power ?

thanks ;)

unplug the power cord, then
# cat /proc/acpi/ac_adapter/C1AB/state
state: off-line

# cat /proc/acpi/battery/C1AC/state
present: yes
capacity state: ok
charging state: discharging


plug/connect the power cord, then
# cat /proc/acpi/ac_adapter/C1AB/state
state: on-line
# cat /proc/acpi/battery/C1AC/state
present: yes
capacity state: ok
charging state: charging

Regards
Maaz