!!!IMPORTANT!!!
Please read this entire README before using the scripts! While they should be harmless when used correctly, you're messing with the device's configuration. If you don't feel comfortable with this, don't use them.

They contain some basic sanity checks, but please make sure you've backed up your data before using them nonetheless. 
The scripts are provided as-is, and I won't accept liability for lost data or devices which need to be reflashed afterwards.
I wrote them only to scratch a personal itch and share them with whomever finds them useful.

Also always double check the values you're setting. 
If you acidentally entered bogus values, don't panic. As there's no obvious way to have the power manager re-read the database, the settings take effect only after a reboot (shutdown and start).

Settings are overwritten when you use the 'Power Management' configuration tool in the 'Settings' menu. 
Mind that this tool remembers the last 'official' setting and only changes values which change with a new selected setting. Thereby, the safe way to overwrite all values in the database is to first select 'Never', then select some option setting both values, then selecting 'Never' again.

You can always check on the current database values by executing get_pm_config.oar, and set_pm_config.oar will update the configuration file pm_config.txt after writing the values to the database.
So if you want to know whether it worked, check the configuration file after writing settings. :)



===
To the unafraid and the adventurous: Here follow the use instructions :) 

Install sqlite3 in /usr/local/bin .


get_pm_config.oar <- fetches the current power manager configuration and writes it to 'text\ editor/pm_config.txt'


You may then edit pm_config.txt via the 'Note' application.
Replace the numeric values with the ones you'd like to set.


A value of '0' disables the function (no suspend, or no shutdown timeout at all).
Other (positive) values are interpreted as SECONDS.

The following example sets the suspend timeout to 5 minutes and the shutdown interval to 1 hour:
suspend_interval|300
shutdown_interval|3600

The following example disables suspend and shutdown timeouts:
suspend_interval|0
shutdown_interval|0


Reminder: !!!Make sure that the values are valid!!!

set_pm_config.oar <- writes the configuration to the database

Since I did not find a way yet to have the power manager re-read the database, new settings take effect after a reboot (shutdown and start the device again). 
Until then, you should recheck the pm_config.txt file whether the values correspond to what you'd expect.



===
To the curious: This is what set_pm_config.oar does:

It searches for two lines containing suspend_interval| and shutdown_interval| , 
appends '000' to the values (as the database stores timout information in miliseconds),
write the resulting value to the database (I can't guarantee that it'll take prisoners - this is why you ought to make sure the values are valid before writing ;) ),
calls get_pm_config.oar to update the configuration file.


