This is what i initially did for switchonbt script, a better way would be to use d-bus commands. Let me know if I can be of help. ~m~ Varghese