plugins/battery: Fix regex for the POSIX compatibility

This commit is contained in:
Koichi Murase
2022-01-05 01:44:32 +09:00
parent b07199fac1
commit 5cbaa84cc7

View File

@ -6,7 +6,7 @@ if ! command -v "command_exists" >/dev/null; then command_exists() { command -v
ac_adapter_connected(){
if command_exists upower;
then
upower -i $(upower -e | grep BAT) | grep 'state' | grep -q '[:[:blank:]]charging\|fully-charged'
upower -i $(upower -e | grep BAT) | grep -qE 'state[:[:blank:]]*(charging|fully-charged)'
return $?
elif command_exists acpi;
then