#!/usr/bin/env sh

name=$(bluetoothctl info | grep "Alias" | sed 's/.*Alias: //')
battery=$(bluetoothctl info | grep "Battery Percentage" | sed 's/.*(//;s/)//')
if [ ! "$name" ]
then
    echo ""
else
    echo -n "" $name;
    if [ "$battery" ]
    then
        echo -n " ($battery%)"
    fi
    echo ""
fi
