You could hookup your inverter to your secondary battery and then take it apart, hookup a relay in parallel (or series if you want) to main switch. And then hook in the ignition wire to the relay to tell it when you key is in the ignition. Then you could do all that business with the capacitor and resistor. You could then have time to shut down the computer without having to have your engine on.
edit: The reason i say series or parallel is that if you want the flip switch to be a "MASTER" switch then you want the relay to be in series. This why if for some reason you don't want the inverter on, you can just simply turn the switch OFF. But you need both switches ON to turn the inverter on. In parallel, the switch or the relay could turn on the power supply but both would have to be off in order for the inverter to turn off.