mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
plugins/battery: Fix regex for the POSIX compatibility
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user