From adcc3618918278df62239a0577b09f3340c24e33 Mon Sep 17 00:00:00 2001 From: Rene Kievits Date: Mon, 18 Apr 2022 05:49:54 +0200 Subject: [PATCH] redone bluetooth widget --- awesome/theme/crylia/scripts/bt.sh | 23 ++++++++++++++++++++++ awesome/theme/crylia/widgets/bluetooth.lua | 16 +++++++-------- 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100755 awesome/theme/crylia/scripts/bt.sh diff --git a/awesome/theme/crylia/scripts/bt.sh b/awesome/theme/crylia/scripts/bt.sh new file mode 100755 index 0000000..d9ddf61 --- /dev/null +++ b/awesome/theme/crylia/scripts/bt.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +DEVICES=$(bluetoothctl paired-devices | cut -f2 -d' '| + while read -r uuid + do + info=`bluetoothctl info $uuid` + if echo "$info" | grep -q "Connected: yes"; then + echo "$info" | head -n 1 | grep "Device" | awk '{print $2}' + fi + done) +NAMES=$(bluetoothctl paired-devices | cut -f2 -d' '| + while read -r uuid + do + info=`bluetoothctl info $uuid` + if echo "$info" | grep -q "Connected: yes"; then + echo "$info" | grep "Name" | awk '{for (i=2; i