PDA

View Full Version : Auto-activate bluetooth when charged


gumby05
7th April 2009, 12:35 AM
I was fiddling around with the programs that I already had installed (SKTools, Mortscript and ToggleBTH.exe, 3 great program btw). What I wanted to achieve is that when I put my Diamond in the car charger, bluetooth is activated (if it was off) and when I removed it from the cradle it was returned to the last state. Reason is that I want my car kit to be able to connect to my Diamond and disable bluetooth when I am not in my car, to save battery power.
What I also wanted is that the program wouldn't be running all the time when my Diamond wasn't externally powered.

This what I did.
I wrote the following script:

If (ExternalPowered())
ToggleDisplay(ON)
BTState = RegRead("HKLM","System\State\Hardware","Bluetooth")
If (BTState <= 8)
BTWasOff = TRUE
Run("\Windows\ToggleBTH.exe")
Else
BTWasOff = FALSE
EndIf
While(ExternalPowered())
Sleep(5000)
EndWhile
If (BTWasOff)
Run("\Windows\ToggleBTH.exe")
EndIf
EndIf

I save the script "PowerBT.mscr" to some place. In SKTools I go to "Notifications queue" and add a new event of the type "wakeup". Then I select to execute the file "PowerBT.mscr".

So far I am very happy with this solution.
Any comments are welcome!

Towelie_NLD
23rd July 2009, 01:51 PM
I'm definitely going to try this, seems really handy. Already found another program, BluePower, which would do the same except it'll always run in the background I think.

ja-marcin
26th July 2009, 11:29 PM
wouldn`t g-profile do the trick?