diff --git a/.config/polybar/bluetooth.sh b/.config/polybar/bluetooth.sh index 5df0214..734c5f4 100755 --- a/.config/polybar/bluetooth.sh +++ b/.config/polybar/bluetooth.sh @@ -3,13 +3,12 @@ if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ] then echo -e "%{F#66ffffff}\uf293" -else - if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ] - then - echo -e "\uf293" -else +elif [ $(echo info | bluetoothctl | grep 'DeviceSet' | wc -c) -eq 0 ] + then 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 + ALIAS=$(bluetoothctl info | grep Alias | cut -d":" -f 2 | xargs echo -n) + echo -e "%{F#81a1c1}\uf293%{F#ffffff}$BAT ($ALIAS)" +else + echo -e "\uf293" fi