![]() |
Re: Desktop Command Execution Widget scripts
I have the script I want to use, but I can't seem to get it to work with DCEW:
-trying to connect to a specific BT MAC address (Nokia BH-503 headphones) I have tried this from karimko: Quote:
However, this only works once BT is on, and doesn't "genuinely connect" (status bar BT icon turns blue, but device does not respond/receive commands). I have tried this: Code:
adapter=$(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}') Code:
run-standalone.sh <directory>/headphones.sh Can anyone point me in the right direction? Nokia revised the programming for their BH-503 (board revision 3), and now I can't connect to my latest pair automatically (must access via the BT menu, despite being "trusted"). |
Re: Desktop Command Execution Widget scripts
Quote:
Run the script from the commandline and post the error messages. |
Re: Desktop Command Execution Widget scripts
1 Attachment(s)
Code:
~ $ sh /home/user/MyDocs/headphones.sh Edit: I know it says .sh.txt, but it's been renamed via FileBox on my N900 .sh. 2nd edit: if someone can recommend a program (Win7 or Maemo) that I can use for writing shell scripts that will save with the correct file extension, I'm all for it. |
Re: Desktop Command Execution Widget scripts
1 Attachment(s)
Try this one.
I removed the DOS lineendings and removed the ${..} around your mac address (this was the "bad substitution" error) |
Re: Desktop Command Execution Widget scripts
Thanks a lot nicolai, I really appreciate it. :)
Code:
~ $ sh /home/user/MyDocs/headphones2.sh |
Re: Desktop Command Execution Widget scripts
1 Attachment(s)
I found a similiar script at the phone control wiki entry.
http://wiki.maemo.org/Phone_control#...pecific_device There are two variables are defined, one for the MAC and one for the service. In your script you missed the "service" variable, too. I changed your code and put the "AudioSink" value in the dbus call. |
Re: Desktop Command Execution Widget scripts
Ah! I had "AutoSink" in there (I know you can put any service in that string, but I wasn't sure what the available options are, or which one I needed).
Code:
~ $ sh /home/user/MyDocs/headphones3.sh Code:
~ $ sh /home/user/MyDocs/headphones3.sh Code:
~ $ sh /home/user/MyDocs/headphones3.sh In DCEW, using Code:
sh /home/user/MyDocs/headphones3.sh Any ideas on having the script also turn BT on (N900) before it attempts connection? I write a script with the content Code:
dbus-send --system --type=method_call --dest=org.bluez /org/bluez/906/hci0 org.bluez.Adaptor.SetProperty string:Powered variant:boolean:true Code:
sh /home/user/MyDocs/Bton.sh |
Re: Desktop Command Execution Widget scripts
1 Attachment(s)
Again :-)
Phone control wiki: http://wiki.maemo.org/Phone_control#Enable I added the "enable" dbus-call command to your script. Nicolai |
Re: Desktop Command Execution Widget scripts
Excellent. Perfect Nicolai. :D
I had some trouble opening the phone Control wiki page for a few minutes there, but found the enable code right when you posted. But as above my little script didn't enable it. Guess it's the way you've inserted the enable command within the rest of the script. So, problem solved. now to make a fancy button. :D |
Re: Desktop Command Execution Widget scripts
Actually, it seems to keep turning BT on now. Which is odd, because it's only when the DCEW is placed on the desktop, yet without pushing on it. Like it's running the script without being called?
Edit: unchecked "Update when switched to the desktop", now it behaves normally (turns BT on only when called). Edit: does not connect to defined MAC address after being called. Buuuuuuuut it helps when I put the right MAC in. D'oh! |
All times are GMT. The time now is 13:52. |
vBulletin® Version 3.8.8