233 current 2025-01-11 21:18:12 25.05.20241217.d3c42f1 6.6.66 *
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
{pkgs, ...}: let
|
{pkgs, ...}: let
|
||||||
bctl = "/run/current-system/sw/bin/bluetoothctl";
|
bctl = "/run/current-system/sw/bin/bluetoothctl";
|
||||||
sctl = "/run/current-system/sw/bin/systemctl";
|
sctl = "/run/current-system/sw/bin/systemctl";
|
||||||
|
grep = "/run/current-system/sw/bin/grep";
|
||||||
in
|
in
|
||||||
pkgs.writeShellScriptBin "bluetooth-ctl" ''
|
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
|
then
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
if [ $(echo info | ${bctl} | grep 'Device' | wc -c) -eq 0 ]
|
if [ $(echo info | ${bctl} | ${grep} 'Device' | wc -c) -eq 0 ]
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
device=$(${bctl} info | grep "Name" | cut -d ' ' -f 2-)
|
device=$(${bctl} info | ${grep} "Name" | cut -d ' ' -f 2-)
|
||||||
if [[ "$device" == "" ]]
|
if [[ "$device" == "" ]]
|
||||||
then
|
then
|
||||||
echo "%{F#2193ff}"
|
echo "%{F#2193ff}"
|
||||||
|
|||||||
Reference in New Issue
Block a user