nixos-config/modules/workspace/i3blocks/scripts/bluetooth.nix

22 lines
537 B
Nix
Raw Normal View History

2020-07-27 01:16:19 +04:00
{ 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
''