From 1910f965bddac6049656accf5c091b4b19bbfd72 Mon Sep 17 00:00:00 2001 From: Yash Karandikar Date: Mon, 11 Jul 2022 19:31:06 +0530 Subject: [PATCH] Don't add a space if percentage is not found --- .config/polybar/bluetooth.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/polybar/bluetooth.sh b/.config/polybar/bluetooth.sh index ad83d5a..5df0214 100755 --- a/.config/polybar/bluetooth.sh +++ b/.config/polybar/bluetooth.sh @@ -8,8 +8,8 @@ else then echo -e "\uf293" else - BAT=$(bluetoothctl info | grep Percentage | cut -d":" -f 2 | cut -d"(" -f 2 | sed 's/)/%/') - echo -e "%{F#81a1c1}\uf293 %{F#ffffff}$BAT" + BAT=$(bluetoothctl info | grep Percentage | cut -d":" -f 2 | cut -d"(" -f 2 | sed 's/)/%/' | sed 's/^/ /') + echo -e "%{F#81a1c1}\uf293%{F#ffffff}$BAT" fi fi