xternal
21st November 2008, 01:16 AM
Hey guys,
I thought i would post this here. Its a mortscript i wrote to automaticlly dismiss the Low Battery notification when your battery goes under 20%.
It works best if you do the mod here http://forum.xda-developers.com/showthread.php?t=331288 and then untick popup message/vibrate etc in 'sounds and notifications'.
#
# NOLBATT.mscr - Monitors notifications and keeps deleting active registry key for low battery
#
# initialize variables
Delete = FALSE
LowBattID = "{A877D663-239C-47A7-9304-0D347F580408}"
# start notification check loop
While ( 1 )
# check the registry for any notifications
If ( RegValueExists( "HKLM", "System\State\Shell\Notifications\Active", "CLSID" ) )
# make sure it's low batt
CLSID = RegRead( "HKLM", "System\State\Shell\Notifications\Active\", "CLSID" )
If ( CLSID eq LowBattID )
Delete = True
EndIf
Else
Delete = False
EndIf
# Delete Active notification for Low battery
# the OS turns it off whenever there is a new notification.
If ( Delete )
RegDeletekey ( "HKLM", "System\State\Shell\Notifications\Active", TRUE, TRUE )
EndIf
# wait 5 seconds
Sleep( 5000 )
EndWhile
Any thoughts on how to make it more efficient etc are appreciated. There is a 'batterypercentage' option in mortscript that could perhaps be utilised to start the script at a certain percentage.
I thought i would post this here. Its a mortscript i wrote to automaticlly dismiss the Low Battery notification when your battery goes under 20%.
It works best if you do the mod here http://forum.xda-developers.com/showthread.php?t=331288 and then untick popup message/vibrate etc in 'sounds and notifications'.
#
# NOLBATT.mscr - Monitors notifications and keeps deleting active registry key for low battery
#
# initialize variables
Delete = FALSE
LowBattID = "{A877D663-239C-47A7-9304-0D347F580408}"
# start notification check loop
While ( 1 )
# check the registry for any notifications
If ( RegValueExists( "HKLM", "System\State\Shell\Notifications\Active", "CLSID" ) )
# make sure it's low batt
CLSID = RegRead( "HKLM", "System\State\Shell\Notifications\Active\", "CLSID" )
If ( CLSID eq LowBattID )
Delete = True
EndIf
Else
Delete = False
EndIf
# Delete Active notification for Low battery
# the OS turns it off whenever there is a new notification.
If ( Delete )
RegDeletekey ( "HKLM", "System\State\Shell\Notifications\Active", TRUE, TRUE )
EndIf
# wait 5 seconds
Sleep( 5000 )
EndWhile
Any thoughts on how to make it more efficient etc are appreciated. There is a 'batterypercentage' option in mortscript that could perhaps be utilised to start the script at a certain percentage.