aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/status/bluetooth-status
blob: 6de5422793e6344874756a2a6700c4bf16346729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env sh

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