From de34f66995b76da3f10fd14182893d71e908ca02 Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Wed, 5 Jun 2024 23:56:35 +0200 Subject: [PATCH] Change order of items in the status bar, additionally, add bluetooth device --- linux_home/.config/sway/status.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/linux_home/.config/sway/status.sh b/linux_home/.config/sway/status.sh index 98b83a4..94a2dbe 100755 --- a/linux_home/.config/sway/status.sh +++ b/linux_home/.config/sway/status.sh @@ -27,8 +27,20 @@ while true; do brightness=$(brightnessctl | grep -oP '[0-9]+(?=%)') brightness_status="Brightness: $brightness%" + bluetooth_device=$(bluetoothctl devices Connected | awk '{$1=$2=""; print $0}' | sed 's/^ *//g') + if [ -z "$bluetooth_device" ]; then + bluetooth_status="" + else + bluetooth_status="Bluetooth: $bluetooth_device" + fi + # Combine all statuses - echo "$battery | $network_status | $brightness_status | $date_time " + final_status="" + if [ -n "$bluetooth_status" ]; then + final_status="$bluetooth_status | " + fi + final_status="$final_status$brightness_status | $battery | $network_status | $date_time " + echo "$final_status" sleep 1 done