From 32cc92623190828e1ad9b4a8abd48fa6f6909b54 Mon Sep 17 00:00:00 2001 From: Kyle San Clemente Date: Wed, 4 Aug 2021 20:57:49 -0700 Subject: [PATCH] Fix grep colorizing output when GREP_OPTIONS='--color=always' is set --- scripts/battery_percentage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/battery_percentage.sh b/scripts/battery_percentage.sh index d5dce55..119b770 100755 --- a/scripts/battery_percentage.sh +++ b/scripts/battery_percentage.sh @@ -11,7 +11,7 @@ print_battery_percentage() { battery=$(find /sys/class/power_supply/*/capacity | tail -n1) cat "$battery" elif command_exists "pmset"; then - pmset -g batt | grep -o "[0-9]\{1,3\}%" + pmset -g batt | grep --color=never -o "[0-9]\{1,3\}%" elif command_exists "acpi"; then acpi -b | grep -m 1 -Eo "[0-9]+%" elif command_exists "upower"; then