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

20 lines
526 B
Nix
Raw Normal View History

2020-08-04 22:52:30 +04:00
{ iconfont, bash, bluez, pulseaudio, utillinux, python3, ... }:
2020-07-27 01:16:19 +04:00
''
#!${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
2020-08-04 22:52:30 +04:00
echo -n ""
2020-07-27 01:16:19 +04:00
else
2020-08-04 22:52:30 +04:00
echo -n ""
2020-07-27 01:16:19 +04:00
fi
else
2020-08-04 22:52:30 +04:00
echo -n ""
2020-07-27 01:16:19 +04:00
fi
else
2020-08-04 22:52:30 +04:00
echo -n ""
2020-07-27 01:16:19 +04:00
fi
fi
''