Reply
Thread Tools
christye's Avatar
Posts: 60 | Thanked: 9 times | Joined on Apr 2010 @ Swindon, UK
#1
Hey hey,

I was wondering if anyone had come across an app which upon pressing a button, does several actions. Like a script, or a macro or something?

For example, I get into my car and turn on: FMTX; start music playing; start bluetooth; start GPS.

It would be awesome if I could press one button that did all of that.

Any suggestions?

Regards,
Chris
 
JohnLF's Avatar
Posts: 551 | Thanked: 507 times | Joined on Feb 2010 @ North West England
#2
Most apps are just python scripts. To run several apps one after the other, you could write a simple shell script. This would say

Code:
path/app1
path/app2
path/app3
Write one, it's not that hard when you get down to it.
Google Linux shell scripts, search this site for examples and have a go - you may surprise yourself!
__________________
My websites: -
http://www.lefebvre.org.uk
http://www.lefebvre.ltd.uk

Last edited by JohnLF; 2010-10-05 at 00:35.
 
Posts: 166 | Thanked: 30 times | Joined on Apr 2010 @ Halifax, UK
#3
download desktop command execution widget and write a script into that then you'll have your button on the desktop
 
Posts: 1,425 | Thanked: 983 times | Joined on May 2010 @ Hong Kong
#4
You can refer to the following: http://wiki.maemo.org/Phone_control

It has example to enable your FMTX, control your mediaplayer.

The bluetooth should start with FMTX, as they're in the same composite chip. You can refer to the same guide for enabling it anyway.

GPS should start automatically with the app you use.

The trick is to execute all these commands at once. You may put them into a script and run them thru Queen Beecon Widget. However, you may also put them into one-line by separating them with &&, e.g.

Code:
echo hello && echo hello twice
 
christye's Avatar
Posts: 60 | Thanked: 9 times | Joined on Apr 2010 @ Swindon, UK
#5
Thanks all for the replies. I'll give it a go today and report back.
 
Posts: 1,425 | Thanked: 983 times | Joined on May 2010 @ Hong Kong
#6
linuxeventually just reminds me to inform you the following:

Originally Posted by linuxeventually
Well... Technically && won't execute the commands at once. In fact it will only execute the second command if there isn't an error associated with the first command. The semicolon ; will run commands consecutively without regard to one of the commands failing. BASH isn't really set up to do simultaneous commands, granted you rarely need them to happen at the same time, consecutively is typically the preferred usage anyway. Just... you know FYI....
In short you may replace && with ; depends on your need. ^^
 
christye's Avatar
Posts: 60 | Thanked: 9 times | Joined on Apr 2010 @ Swindon, UK
#7
OK, I've managed to do part of it thanks to all of your help. I'm using the Desktop Command Execution widget, one I have configured to turn things on, the other to turn them off.

I just put: command && command

Seems to work really well from what I can tell so far.

Still searching the internet for a way to enable GPS with a command, as I want it enabled without starting a map program, as I don't always want a map up, but when I do I would like an instant GPS lock, so having it enabled without the program running would be an advantage.

=D Thanks so far guys
 
christye's Avatar
Posts: 60 | Thanked: 9 times | Joined on Apr 2010 @ Swindon, UK
#8
Right.

I have gotten most things working.

Now, using Desktop Execution Widget (DEW), I can:

- connect to the internet
- start FMTX
- boost FMTX power
- play music
- start bluetooth

I don't think I can make the GPS turn on in the background, I've spent the past day or 2 researching and writing scripts (all trial and error, I have no idea what I'm doing!) for the GPS. They all seem to need a loop, which DEW doesn't like, in fact it stops responding and I then lose all of my widgets.


So, I'll compromise and just be more patient in waiting for my GPS to get a lock, its normally under 10 seconds anyway.
I can start the script in a terminal window using the osso-xterm command, but haven't found a way yet to minimise/send this straight to the background. Don't suppose anyone knows such a command? Either as a command switch or something I could put within the python script?

Thanks for your help all =]
 
christye's Avatar
Posts: 60 | Thanked: 9 times | Joined on Apr 2010 @ Swindon, UK
#9
The Desktop Execution Widget one?

After installing it, the commands can be found here: http://wiki.maemo.org/Desktop_Comman...Widget_scripts

And here:
http://wiki.maemo.org/Phone_control

Put && in between command

=]
 
Posts: 155 | Thanked: 61 times | Joined on Nov 2009
#10
I have a script that is triggered using dbus-scripts when the phone starts charging. It scans for various things - bluetooth devices, wifi networks etc to find out where it is, then does a bunch of things accordingly - like force a bluetooth connect to my car stereo (which normally doesnt happen automatically..grrr) but can also start backups or vpns etc. I need to tidy it up a bit for general consumption - but it works a treat.
 
Reply


 
Forum Jump


All times are GMT. The time now is 15:28.