in reply to Laptop Battery Percentage
If the charge is at 100% you are only picking up the last two zeros.
Simple would be:
#!/usr/bin/perl print 'Battery: ', ( `acpi` =~ /(\d+)%/ )[ 0 ] // '??';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Laptop Battery Percentage
by naildownx (Beadle) on Aug 01, 2011 at 12:48 UTC | |
|
Re^2: Laptop Battery Percentage
by naildownx (Beadle) on Aug 07, 2011 at 04:14 UTC |