aboutsummaryrefslogtreecommitdiff
path: root/Scripts
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-23 17:06:01 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-23 17:06:01 +0530
commitae73ed6dc63ad182ffcfecdf2a464bede4b33ff0 (patch)
tree43590a4aac0a131fc3ecb3d6c1114824b364d642 /Scripts
parente46d8b18ea0c31f074fe70f7df6061556b71f570 (diff)
downloaddotfiles-ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0.tar.gz
dotfiles-ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0.tar.bz2
dotfiles-ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0.zip
(Scripts/status)~bluetooth-status now prints battery info if found
Diffstat (limited to 'Scripts')
-rwxr-xr-xScripts/.local/scripts/status/bluetooth-status8
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