(Scripts/status)~bluetooth-status now prints battery info if found
This commit is contained in:
@@ -1,9 +1,15 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
name=$(bluetoothctl info | grep "Name" | sed 's/.*Name: //')
|
name=$(bluetoothctl info | grep "Name" | sed 's/.*Name: //')
|
||||||
|
battery=$(bluetoothctl info | grep "Battery" | sed 's/.*(//;s/)//')
|
||||||
if [ ! "$name" ]
|
if [ ! "$name" ]
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
echo "" $name;
|
echo -n "" $name;
|
||||||
|
if [ "$battery" ]
|
||||||
|
then
|
||||||
|
echo -n " ($battery%)"
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user