nixos-config/modules/workspace/i3blocks/scripts/bluetooth.nix
2020-07-28 13:38:08 +03:00

22 lines
537 B
Nix

{ iconfont, bash, bluez, pulseaudio, utillinux, ... }:
''
#!${bash}/bin/bash
if ${utillinux}/bin/rfkill | grep bluetooth > /dev/null; then
if ${utillinux}/bin/rfkill | grep bluetooth | grep blocked > /dev/null; then
if ${bluez}/bin/bluetoothctl info > /dev/null; then
if ${pulseaudio}/bin/pactl list sinks | grep bluez > /dev/null; then
echo ""
exit 33
else
echo ""
fi
else
echo ""
fi
else
echo ""
exit 33
fi
fi
''