Update regular expression to be POSIX compatible

This commit is contained in:
DaarkMoon
2022-01-04 16:42:59 +01:00
committed by Koichi Murase
parent 614fa98211
commit b07199fac1

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 '[: \t]charging\|fully-charged'
upower -i $(upower -e | grep BAT) | grep 'state' | grep -q '[:[:blank:]]charging\|fully-charged'
return $?
elif command_exists acpi;
then