From 5344931dd279034d33c7d8ec0890dee7406ff900 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Sat, 11 Jan 2025 21:18:21 -0500 Subject: [PATCH] 233 current 2025-01-11 21:18:12 25.05.20241217.d3c42f1 6.6.66 * --- home/programs/polybar/scripts/bluetooth.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/home/programs/polybar/scripts/bluetooth.nix b/home/programs/polybar/scripts/bluetooth.nix index 28f1c3f..074b191 100644 --- a/home/programs/polybar/scripts/bluetooth.nix +++ b/home/programs/polybar/scripts/bluetooth.nix @@ -1,17 +1,18 @@ {pkgs, ...}: let bctl = "/run/current-system/sw/bin/bluetoothctl"; sctl = "/run/current-system/sw/bin/systemctl"; + grep = "/run/current-system/sw/bin/grep"; in pkgs.writeShellScriptBin "bluetooth-ctl" '' - if [ $(${bctl} show | grep "Powered: yes" | wc -c) -eq 0 ] + if [ $(${bctl} show | ${grep} "Powered: yes" | wc -c) -eq 0 ] then echo "" else - if [ $(echo info | ${bctl} | grep 'Device' | wc -c) -eq 0 ] + if [ $(echo info | ${bctl} | ${grep} 'Device' | wc -c) -eq 0 ] then echo "" fi - device=$(${bctl} info | grep "Name" | cut -d ' ' -f 2-) + device=$(${bctl} info | ${grep} "Name" | cut -d ' ' -f 2-) if [[ "$device" == "" ]] then echo "%{F#2193ff}"