View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#1086
Originally Posted by moudy91 View Post
hi.
please can you help me with this command because i cant figure out how to make it.
if [ "$QBW_EXEC_REASON" == "QBW_STARTUP_UPDATE" ]; then
# add here switch on instructions
echo "ON";
exit 1;
fi;

if [ "$QBW_CURRENT_RESULTS_TEXT" == "ON" ]; then
# add here switch off instructions
echo "OFF";
exit 0;
else
# add here switch on instructions
echo "ON";
exit 1;
fi;


but i want it to enable and disable bluetooth in beecon with on click
thank you and regards
PHP Code:
if [ "$QBW_EXEC_REASON== "QBW_STARTUP_UPDATE" ]; then
#    add here switch on instructions
    
dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez org.bluez.Manager.ListAdapters awk -F'"' '/at/ {print $2}'org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
    
echo "ON";
    exit 
1;
fi;

if [ 
"$QBW_CURRENT_RESULTS_TEXT== "ON" ]; then
#    add here switch off instructions
    
dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez org.bluez.Manager.ListAdapters awk -F'"' '/at/ {print $2}'org.bluez.Adapter.SetProperty string:Powered variant:boolean:false
    
echo "OFF";
    exit 
0;
else
#    add here switch on instructions
    
dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez org.bluez.Manager.ListAdapters awk -F'"' '/at/ {print $2}'org.bluez.Adapter.SetProperty string:Powered variant:boolean:true
    
echo "ON";
    exit 
1;
fi
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post: