231 current 2025-01-11 21:09:28 25.05.20241217.d3c42f1 6.6.66 *

This commit is contained in:
2025-01-11 21:09:38 -05:00
parent 6eee851ce7
commit ec84fd7a57
3 changed files with 47 additions and 7 deletions

View File

@@ -0,0 +1,22 @@
{pkgs, ...}: let
bctl = "/run/current-system/sw/bin/bluetoothctl";
sctl = "/run/current-system/sw/bin/systemctl";
in
pkgs.writeShellScriptBin "bluetooth-ctl" ''
if [ $(${bctl} show | grep "Powered: yes" | wc -c) -eq 0 ]
then
echo ""
else
if [ $(echo info | ${bctl} | grep 'Device' | wc -c) -eq 0 ]
then
echo ""
fi
device=$(${bctl} info | grep "Name" | cut -d ' ' -f 2-)
if [[ "$device" == "" ]]
then
echo "%{F#2193ff}"
else
echo "%{F#2193ff} %{F#ffffff}[$device]"
fi
fi
''