We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex should be changed to support one to three digits number.
BAT=$(acpi -b | grep -E -o '[0-9][0-9]?[0-9]?%')
The text was updated successfully, but these errors were encountered:
Oh, true. I guess the following is even more appropriate.
BAT=$(acpi -b | grep -E -o '[0-9]{1,3}%')
However, I do not recall il the braces should be escaped.
Sorry, something went wrong.
if acpi isn't installed the battery charge can be found using grep -P -o '(?<=^POWER_SUPPLY_CAPACITY=)\w*$' /sys/class/power_supply/BAT0/uevent
acpi
grep -P -o '(?<=^POWER_SUPPLY_CAPACITY=)\w*$' /sys/class/power_supply/BAT0/uevent
No branches or pull requests
Regex should be changed to support one to three digits number.
The text was updated successfully, but these errors were encountered: