commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
This prints "Charging" or "Discharging". Obviously, this will indicate the status of the AC adapter. The awk part could be from 1-6. I removed the comma because it is useless when only looking at one element of the output array. See acpi(1) for more info.
There are 4 alternatives - vote for the best!
The original proc file doesn't exist on my system.
In my case it was actually like this...
With progress bar.. hahaa this is friggin' kludge
If you can do better, submit your command here.
You must be signed in to comment.