#!/usr/bin/env bash

powered=$(bluetoothctl show | grep -i "powered" | grep -i "yes" | wc -l)

if [[ "$powered" -eq 1 ]]; then
    val=$(bluetoothctl devices Connected | wc -l)
    echo "(label :class \"bluetooth__label\" :text \"$val\")"
else
    echo "(label :class \"bluetooth__label\" :text \"-\")"
fi
