Connects audio device using hcitool and bt-device/bt-audio/bt-obex/bt-network etc. Connects and Disconnects, shows added devices and current connection.
First scan then press one of the buttons for the desired connection type. Then select by highlighting the mac address of the device to be used, drag the mac to the dnd pane at the lower half of the gui, and wait for the results in the same gui.
This is my first use of hcitool and bluez in bash/cli ... any pointers welcomed.
Work in progress.
this is for bluez4
Code: Select all
#!/bin/sh
# simple bluetooth connection gui tool
# by stemsee copyright @ 2019 Marcos M Contant
#
[[ "`whoami`" != "root" ]] && exec sudo -E -S ${0} "$\""
export OUTPUT_CHARSET=UTF-8
running=`ps -e | grep bt.sh | wc -l`
[[ "$running" -gt 2 ]] && exit #check if running, one instance only
export camino=$HOME/.wifi-connect
export track=/tmp/Wifi-TrayNet
export pics=/usr/share/pixmaps
[[ ! -d /tmp/Wifi-TrayNet ]] && mkdir /tmp/Wifi-TrayNet
function sayonara { #MochiMoppel/stemsee geometry recorder
[[ ! -f "$track"/geom ]] && exit
yad --text="$WINDOWTITLE: WT Geometry-Recorder" --window-icon="$pics/wireless.png" \
--geometry=200x10+100-100 --no-focus --no-buttons --undecorated \
--on-top --form --skip-taskbar --field="MoreTime:FBTN" "bash -c sayonara" \
--timeout-indicator=top --timeout=6
nought=`xwininfo -stats -name "$WINDOWTITLE" | grep "$WINDOWTITLE"`
XWININFO=`xwininfo -stats -name "$WINDOWTITLE"`
if [[ ! -z "$nought" ]]; then
ARRAY=(${XWININFO#* X: })
AX=${ARRAY[0]}
AY=${ARRAY[4]}
RX=${ARRAY[8]}
RY=${ARRAY[12]}
W=${ARRAY[14]}
H=${ARRAY[16]}
X=$((AX-RX))
Y=$((AY-RY))
echo "$W"x"$H"+"$X"+"$Y" > $camino/geometry/$WINDOWTITLE
else
exit
fi
}; export -f sayonara
function btscanfn (){
timeout 14 hcitool scan | grep -v 'Scanning' | tr '\t' ' ' >/tmp/Wifi-TrayNet/btresults &
function flash (){
echo -e '\f'
sleep 0.4
echo "Please Wait ... !"
sleep 0.4
}; export -f flash
for i in `seq 1 1 13`
do
bash -c flash
done
cat /tmp/Wifi-TrayNet/btresults
}; export -f btscanfn
function btcon (){
bash -c btset
echo "DnD mac to connect"
cat /tmp/Wifi-TrayNet/btresults
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
listed=`bt-device -l | grep $line`
if [[ -z "$listed" ]]; then
bt-device -c $line
else
hcitool lecc $line
fi
bt-audio -c $line
bash -c blank
done
}; export -f btcon
function btobex (){
kill $btpid >/dev/null
bash -c btset
kill $obxpid
echo "DnD mac for btobex"
sleep 1
cat /tmp/Wifi-TrayNet/btresults
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
bt-obex -s &
export obxpid=$!
echo -e "#
# RFCOMM configuration file.
#
rfcomm4 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device $line;
#
# # RFCOMM channel for the connection
channel 4;
#
# # Description of the connection
comment \"Bluetooth rfcomm4 $line\";
}
" > /etc/bluetooth/rfcomm.conf
yes | bt-obex -s /root/Downloads &
export btpid=$!
listed=`bt-device -l | grep $line`
if [[ -z "$listed" ]]; then
bt-device -c $line --set Trusted
rfcomm connect rfcomm4 4
bt-obex -f $line &
wait $!
else
hcitool lecc $line
rfcomm connect rfcomm4 4
bt-obex -f $line &
wait $!
fi
bash -c blank
done &
export btobexpid=$!
}; export -f btobex
function btnet (){
bash -c btset
echo "DnD mac for network"
sleep 1
cat /tmp/Wifi-TrayNet/btresults
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
listed=`bt-device -l | grep $line`
if [[ -z "$listed" ]]; then
bt-device -c $line
sleep 2
bt-network -c $line
bt-network -f $line
bt-network -s $line
else
echo "yes" | hcitool lecc $line
sleep 2
bt-network -c $line
bt-network -s $line
bt-network -f $line
fi
sleep 3
bash -c blank
done
}; export -f btnet
function btdisconfn (){
bash -c btset
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
bt-device -d $line
hcitool ledc $line
hcitool dc $line
sleep 3
bash -c blank
done
}; export -f btdisconfn
function rmdev (){
bash -c btset
echo "Drag'n'Drop mac of device to remove"
bt-device -l
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
bt-device -r $line
sleep 3
bash -c blank
done
}; export -f rmdev
function macrx (){
echo "macrx"
tail -fn0 /tmp/Wifi-TrayNet/hciselect | while read line
do
dupe=`echo "$line" | grep -ixE '([0-9A-Z:]*)'`
if [[ ! -z "$dupe" ]]; then
echo "$line" > /tmp/Wifi-TrayNet/btmac
else
echo "$line" > /tmp/Wifi-TrayNet/btcmd
fi
done &
export macrxpid=$!
}; export -f macrx
function combt (){
bash -c btset
tail -fn0 /tmp/Wifi-TrayNet/btfn | while read line
do
echo -e '\f'
case $line in
btcon) cat /tmp/Wifi-TrayNet/btresults;;
input|btnet|btobex|btsend|btdiscon) hcitool con;;
rmdev) bt-device -l;;
esac
[[ ! -z "$line" ]] && bash -c "$line" &>/tmp/Wifi-TrayNet/btpipe &
export funcpid=$!
done &
export combtpid=$!
}; export -f combt
function btftp (){
bash -c btset
sleep 2
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
bt-obex -f "$line" &
wait $!
done
}; export -f btftp
function btserial (){
bash -c btset
sleep 2
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
echo -e "#
# RFCOMM configuration file.
#
rfcomm4 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device $line;
#
# # RFCOMM channel for the connection
channel 4;
#
# # Description of the connection
comment \"Bluetooth rfcomm4 $line\";
}
" > /etc/bluetooth/rfcomm.conf
rfcomm connect rfcomm4 4
bt-obex -f $line &
wait $!
bash -c blank
done
}; export -f btftp
function btsend (){
bash -c btset
sleep 1
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
bt-obex -s &
export obxpid=$!
echo -e "#
# RFCOMM configuration file.
#
rfcomm4 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device $line;
#
# # RFCOMM channel for the connection
channel 4;
#
# # Description of the connection
comment \"Bluetooth rfcomm4 $line\";
}
" > /etc/bluetooth/rfcomm.conf
this=`yad --file`
[[ -z "$this" ]] && exit
rfcomm connect rfcomm4 4
yes | bt-obex -p "$line" "$this" &
wait $!
sleep 1
bash -c blank
done
}; export -f btsend
function btget (){
echo "ftp search"
sdptool search FTP
tail -fn0 /tmp/Wifi-TrayNet/btmac | while read line
do
echo -e "#
# RFCOMM configuration file.
#
rfcomm4 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device $line;
#
# # RFCOMM channel for the connection
channel 4;
#
# # Description of the connection
comment \"Bluetooth rfcomm4 $line\";
}
" > /etc/bluetooth/rfcomm.conf
rfcomm connect rfcomm4 4
rfcomm listen 4
obexfs -b$line
cd /
ls /
done
}; export -f btget
function btset (){
echo -e '\f'
hcitool con >/tmp/Wifi-TrayNet/btpipe
kill $funcpid >/dev/null
}; export -f btset
function funclist (){
export tap=/tmp/Wifi-TrayNet/selecthci
echo "bash -c blank"
echo "bash -c btcon"
echo "bash -c btdisconfn"
echo "bash -c btnet"
echo "bash -c btobex"
echo "bash -c btscanfn"
echo "bash -c btsend"
echo "bash -c btrmdev"
echo "bash -c btget"
echo "bash -c btftp"
echo "bash -c command"
echo "What have you?"
tail -fn0 /tmp/Wifi-TrayNet/selecthci | while read line
do
if [[ -z "$line" ]]; then
echo "nope"
bash -c command
else
bash -c blank
exec $line
fi
export tap=/tmp/Wifi-TrayNet/hciselect
done
}; export -f funclist
function command (){
export tap=/dev/null
echo -e '\f'
echo "bash -c funclist"
echo "rfkill block bluetooth"
echo "rfkill unblock bluetooth"
echo "hcitool lewladd"
echo "bt-device -l"
echo "rfcomm connect rfcomm4 4"
echo "bash -c btsend"
echo "geany /usr/sbin/Wifi-TrayNet"
echo "ls /root/.wifi-connect/profiles"
echo "cat /tmp/Wifi-TrayNet/btresults"
echo "google-chrome-stable --no-sandbox www.google.com"
echo "seamonkey http://www.murga-linux.com/puppy/"
#line=$(yad --geometry=100x100+100+100 --on-top --text="Command D'n'D" --undecorated --skip-taskbar --dnd)
tail -fn0 /tmp/Wifi-TrayNet/selecthci | while read line
do
if [[ -z "$line" ]]; then
echo "nope"
bash -c command
else
bash -c blank
exec $line
fi
export tap=/tmp/Wifi-TrayNet/hciselect
done
}; export -f command
function blank (){
echo -e '\f' >/tmp/Wifi-TrayNet/btpipe
}; export -f blank
function bluetooth (){
kill $btpid &>/dev/null
kill $combtpid &>/dev/null
kill $macrxpid &>/dev/null
export tap=/tmp/Wifi-TrayNet/hciselect
export pat=/tmp/Wifi-TrayNet/selecthci
[[ ! -f /tmp/Wifi-TrayNet/btpipe ]] && mkfifo -m 755 /tmp/Wifi-TrayNet/btpipe
exec 2<> /tmp/Wifi-TrayNet/btpipe
[[ ! -f /tmp/Wifi-TrayNet/hciselect ]] && touch /tmp/Wifi-TrayNet/hciselect
[[ ! -f /tmp/Wifi-TrayNet/selecthci ]] && touch /tmp/Wifi-TrayNet/selecthci
[[ ! -f /tmp/Wifi-TrayNet/btfn ]] && touch /tmp/Wifi-TrayNet/btfn
[[ ! -f /tmp/Wifi-TrayNet/btmac ]] && touch /tmp/Wifi-TrayNet/btmac
WINDOWTITLE="Bluetooth"
export WINDOWTITLE
bash -c sayonara &
yad --listen --plug=$$ --tabnum=1 --item-separator=" " --form --cycle-read --columns=2 --field=A --field=0 --field=1 --field=2 --field=3 --field=4 --field=5 --field=6 --field=7 --field=8 --field=9 --field=10 <& 2 &
yad --plug=$$ --tabnum=2 --text="\t\t\t\t\t\t\tDnD panel\n\tClick a button Then Drag the mac address here!\n\tDrop command string here..." --dnd | tee $pat >$tap &
yad --geometry=$(cat $camino/geometry/$WINDOWTITLE) --title="$WINDOWTITLE" --window-icon=$pics/bluetooth-active.png --key=$$ --columns=2 --paned --height=220 --width=300 --tab=Found --tab=DnD --button="Command":"echo command" --button="Scan":"echo btscanfn" --button="Remove":"echo rmdev" --button="Connect":"echo btcon" --button="Disconnect":"echo btdisconfn" >/tmp/Wifi-TrayNet/btfn &
bash -c macrx &
bash -c combt &
sleep 0.1
echo -e '\f' >/tmp/Wifi-TrayNet/btpipe
}; export -f bluetooth
bash -c bluetooth &
edit your bluetooth.service startup file so that the daemon 'bluetoothd' starts in compat mode, 'bluetoothd --compat &'
and starts 'obexd -a &'
plus sdptool add FTP
sdptool add OPUSH
sdptool add KBD
or other services.
Code: Select all
#!/bin/sh
[[ "`whoami`" != "root" ]] && exec sudo -A ${0} ${@}
running=`ps -e | grep blueteeth | wc -l`
[[ "$running" -gt 2 ]] && exit
[[ ! -d /tmp/blueteeth ]] && mkdir /tmp/blueteeth
function btscanfn (){
echo -e '\f'
echo "Scanning! Click connect button to see results"
sleep 1
bluetoothctl
scan on
}; export -f btscanfn
function btcon (){
bash -c btset
bluetoothctl devices | awk '{fflush();print;fflush()}' | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10}'
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | awk '{fflush();print;fflush()}' | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
listed=`bluetoothctl paired-devices | grep $line`
if [[ ! -z "$listed" ]]; then
bluetoothctl trust $line &
wait $!
timeout 8 bluetoothctl connect $line &
wait $!
else
unset ok
while [[ -z "$ok" ]]; do bluetoothctl pair $line; sleep 22; ok=`bluetoothctl paired-devices | grep $line`; [[ ! -z "$ok" ]] && break; done
bluetoothctl trust $line
unset hao
while [[ -z "$hao" ]]; do bluetoothctl connect $line; sleep 22; hao=`hcitool connected | grep $line`; [[ ! -z "$hao" ]] && break; done
fi
done
}; export -f btcon
function btobex (){
kill "$btpid"
bash -c btset
bluetoothctl paired-devices | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10}'
tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
export line
bash -c rfcomfn
listed=`bt-device -l | grep $line`
if [[ ! -z "$listed" ]]; then
timeout 8 bluetoothctl connect $line
else
bluetoothctl pair $line
bluetoothctl trust $line
timeout 8 bluetoothctl connect $line
fi
rfcomm connect rfcomm4 4
export btpid=$!
wait $!
done &
}; export -f btobex
function btnet (){
bash -c btset
echo "DnD mac for network"
sleep 1
bluetoothctl devices | awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10}'
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
listed=`bluetoothctl paired-devices | grep $line`
if [[ ! -z "$listed" ]]; then
timeout 8 bluetoothctl connect $line
else
bluetoothctl pair $line
bluetoothctl trust $line
timeout 8 bluetoothctl connect $line
fi
enil=`bluetoothctl list | awk '{print $2}'`
( sleep 4; echo "nameserver 8.8.8.8" >/etc/resolv.conf; busybox udhcpc -i bnep0 ) &
bt-network -a $enil -c $line nap &
echo -e "#!/bin/sh
line=$line
enil=$enil
( sleep 4; echo \"nameserver 8.8.8.8\" >/etc/resolv; busybox udhcpc -i $enil ) &
bt-network -a \$enil -c \$line nap &
" >$camino/"\"blth\"+$line"
chmod 755 $camino/"\"blth\"+$line"
return 0
done
}; export -f btnet
function btdisconfn (){
bash -c btset
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
unset ok
[[ ! -z "$brk" ]] && exec "$brk"
while [[ "$ok" = "" ]]; do bluetoothctl disconnect $line; sleep 7; ok=`hcitool connected | grep $line`; [[ -z "$ok" ]] && break; done
done
}; export -f btdisconfn
function macrx (){
kill ${macrxpid}
bash -c btset
echo "macrx"
tail -Fn0 /tmp/blueteeth/hciselect | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
dupe=`echo "$line" | grep -ixE '([0-9A-Z:]*)'`
if [[ ! -z "$dupe" ]]; then
echo "$line" > /tmp/blueteeth/btmac
else
echo "$line" > /tmp/blueteeth/btcmd
fi
done &
export macrxpid=$!
}; export -f macrx
function rfcomfn (){
[[ ! -z "$rfpid" ]] && kill $rfpid
[[ ! -z "$rfpd" ]] && kill $rfpd
[ ! -f /etc/bluetooth/rfcomm.conf ] && echo -e "#
# RFCOMM configuration file.
#
rfcomm4 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device $line;
#
# # RFCOMM channel for the connection
channel 4;
#
# # Description of the connection
comment \"Bluetooth rfcomm4 $line\";
}
" > /etc/bluetooth/rfcomm.conf
rfcomm connect rfcomm4 4 &
export rfpid=$!
rfcomm listen 4 &
export rfpd=$!
}; export -f rfcomfn
function toggle (){
[[ ! -f /tmp/blueteeth/toggle ]] && touch /tmp/blueteeth/toggle || rm -f /tmp/blueteeth/toggle
[[ -f /tmp/blueteeth/toggle ]] && service bluetooth stop || service bluetooth start
[[ -f /tmp/blueteeth/toggle ]] && systemctl disable bluetooth.service || systemctl enable bluetooth.service
}; export -f toggle
function combt (){
kill ${compid}
kill $funcpid
bash -c btset
tail -Fn0 /tmp/blueteeth/btfn | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
echo -e '\f'
case $line in
btcon) bluetoothctl devices;;
btrmdev|input|btnet|btobex|btsend|btdiscon) bluetoothctl paired-devices;;
esac
[[ ! -z "$line" ]] && ( bash -c "$line" >/tmp/blueteeth/btpipe ) &
export funcpid=$!
done &
export compid=$!
}; export -f combt
function btftp (){
bash -c btset
kill $btpid
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
obexftp -b -c/ &
export btpid=$!
wait $!
done
}; export -f btftp
function btserial (){
bash -c btset
kill $btpid
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
export $line
bash -c rfcomfn
rfcomm connect rfcomm4 4
bt-obex -y -c/root/Downloads -a $BTDEV -s
export btpid=$!
wait $!
bash -c blank
done
}; export -f btserial
function btrmdev (){
bash -c btset
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
bluetoothctl disconnect $line
bluetoothctl untrust $line
bluetoothctl remove $line
done
}; export -f btrmdev
function btsend (){
bash -c btset
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
export $line
bash -c rfcomfn
this=`yad --file`
[[ -z "$this" ]] && exit
rfcomm connect rfcomm4 4 &
rfpid=$!
bt-obex -y -d -b "$line" "$this" &
wait $!
sleep 1
kill $rfpid 2>/dev/null
done
}; export -f btsend
function btget (){
echo "ftp search"
timeout 8 sdptool search FTP
timeout 24 tail -Fn0 /tmp/blueteeth/btmac | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
export $line
bash -c rfcomfn
obexfs -b$line
cd /
ls /
done
}; export -f btget
function btset (){
kill ${compid}
kill $funcpid
bluetoothctl scan off
echo -e '\f'
hcitool con >/tmp/blueteeth/btpipe
}; export -f btset
function funclist (){
bash -c blank
export tap=/tmp/blueteeth/selecthci
echo "bash -c blank"
echo "bash -c btcon"
echo "bash -c btdisconfn"
echo "bash -c btnet"
echo "bash -c btobex"
echo "bash -c btscanfn"
echo "bash -c btsend"
echo "bash -c btrmdev"
echo "bash -c btget"
echo "bash -c btftp"
echo "bash -c command"
echo "bash -c rfcomfn"
echo "bash -c serial"
echo "What have you?"
timeout 24 tail -Fn0 /tmp/blueteeth/selecthci | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
if [[ -z "$line" ]]; then
echo "nope"
else
bash -c blank
exec $line
fi
export tap=/tmp/blueteeth/hciselect
done
}; export -f funclist
function command (){
bash -c blank
export tap=/dev/null
echo -e '\f'
echo "bash -c funclist"
echo "rfkill block bluetooth"
echo "rfkill unblock bluetooth"
echo "bluetoothctl scan on"
echo "bluetoothctl scan off"
echo "bluetoothctl discoverable on"
echo "bluetoothctl pairable on"
echo "rfcomm connect rfcomm4 4"
echo "bash -c btsend"
echo "cat /tmp/blueteeth/btresults"
echo "google-chrome-stable --no-sandbox www.google.com"
echo "seamonkey http://www.murga-linux.com/puppy/"
echo "bash -c blank"
echo "bash -c btcon"
echo "bash -c btdisconfn"
echo "bash -c btnet"
echo "bash -c btobex"
echo "bash -c btscanfn"
echo "bash -c btsend"
echo "bash -c btrmdev"
echo "bash -c btget"
echo "bash -c btftp"
echo "bash -c serial"
echo "bash -c rfcomfn"
echo "bash -c command"
echo "bt-obex -y -a `bluetoothctl list | cut -f2 -d' '` -s"
echo "obexfs --help"
echo "obexftp --help"
echo "obexd --help"
echo "bt-obex --help"
echo "obexftpd --help"
echo "obexautofs --help"
echo "obex-client-tool --help"
echo "obex-server-tool --help"
echo "obex-check-device --help"
#line=$(yad --geometry=100x100+100+100 --on-top --text="Command D'n'D" --undecorated --skip-taskbar --dnd)
timeout 24 tail -Fn0 /tmp/blueteeth/selecthci | while read line
do
[[ ! -z "$brk" ]] && exec "$brk"
if [[ -z "$line" ]]; then
echo "nope"
else
bash -c blank
exec $line
fi
export tap=/tmp/blueteeth/hciselect
done
}; export -f command
function blank (){
echo -e '\f' >/tmp/blueteeth/btpipe
}; export -f blank
function bluetooth (){
kill $btpid 2>/dev/null
kill $compid 2>/dev/null
kill $macrxpid 2>/dev/null
export tap=/tmp/blueteeth/hciselect
export pat=/tmp/blueteeth/selecthci
[[ -f /tmp/blueteeth ]] && rm -f /tmp/blueteeth
[[ ! -f /tmp/blueteeth/btpipe ]] && mkfifo -m 755 /tmp/blueteeth/btpipe
exec 2<> /tmp/blueteeth/btpipe
[[ ! -f /tmp/blueteeth/hciselect ]] && touch /tmp/blueteeth/hciselect
[[ ! -f /tmp/blueteeth/selecthci ]] && touch /tmp/blueteeth/selecthci
[[ ! -f /tmp/blueteeth/btfn ]] && touch /tmp/blueteeth/btfn
[[ ! -f /tmp/blueteeth/btmac ]] && touch /tmp/blueteeth/btmac
export BTDEV=`bluetoothctl list | awk '{print $2}'`
WINDOWTITLE="Blueteeth"
export WINDOWTITLE
bash -c sayonara &
fields=$(for i in {1..43}; do echo "--field=$i "; done)
yad --listen --plug=$$ --tabnum=1 --item-separator=" " --form \
--cycle-read --columns=3 --field=A --field=0 $fields <& 2 &
yad --plug=$$ --tabnum=2 --text="\t\t\t\t\tDnD panel\n\tClick a button \
Then Drag the mac-address or command here!" --dnd | tee $pat >$tap &
yad --geometry=$(cat $camino/geometry/$WINDOWTITLE) --title="$WINDOWTITLE" \
--window-icon=$pics/bluetooth-active.png --key=$$ --paned \
--height=220 --width=300 --tab=Found --tab=DnD --button="toggle service":"echo toggle" --button="Command":"echo command" \
--button="Scan":"echo btscanfn" --button="Remove":"echo btrmdev" \
--button="Connect":"echo btcon" --button="Disconnect":"echo btdisconfn" >/tmp/blueteeth/btfn &
yp=$!
bash -c macrx &
export macrxpid=$!
bash -c combt &
export compid=$!
bt-obex -y -a `bluetoothctl list | awk '{print $2}'` -s &
sleep 0.1
echo -e '\f' >/tmp/blueteeth/btpipe
wait $yp
killall bash
}; export -f bluetooth
bash -c bluetooth &