diff options
-rwxr-xr-x | Scripts/.local/scripts/status/bluetooth-status | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Scripts/.local/scripts/status/bluetooth-status b/Scripts/.local/scripts/status/bluetooth-status index c34694c..6de5422 100755 --- a/Scripts/.local/scripts/status/bluetooth-status +++ b/Scripts/.local/scripts/status/bluetooth-status @@ -1,9 +1,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 "" $name; + echo -n "" $name; + if [ "$battery" ] + then + echo -n " ($battery%)" + fi + echo "" fi |