Detect computer's battery capacity

Can i know if there is a way for arduino to detect computer’s battery capacity? For example, if the battery of a laptop fall below 20%, i will make it turn on an led, can this be done?

Doesn't your operating system already warn you?

I dun wanna use that XDXD i would like to program it onto arduino, way more interesting

Normally the battery has the circuitry inside it: https://en.wikipedia.org/wiki/Smart_battery

All you need to do is add some extra wires to the connector in your laptop then decode the signals. No, I don't know how to do that part. Use google.

ElectronicsIsLife:
I dun wanna use that XDXD i would like to program it onto arduino, way more interesting

Accessing the battery’s microcontroller is going to be difficult and not something that is recommended.

You’re better off to write an application on the PC that uses calls to the OS to determine the state of the battery, and then communicate over serial with your Arduino.

Not a trivial project, but not impossible either.