diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-04-23 17:06:01 +0530 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-04-23 17:06:01 +0530 |
commit | ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0 (patch) | |
tree | 43590a4aac0a131fc3ecb3d6c1114824b364d642 | |
parent | e46d8b18ea0c31f074fe70f7df6061556b71f570 (diff) | |
download | dotfiles-ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0.tar.gz dotfiles-ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0.tar.bz2 dotfiles-ae73ed6dc63ad182ffcfecdf2a464bede4b33ff0.zip |
(Scripts/status)~bluetooth-status now prints battery info if found
-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 |