you can get switches at electronics part places that act like contacts so that when the bed cover is open the circuit would be and the light would come on, and when it is closed it turns the light off..
wiring an alarm into it would almost be impossible, you could just get a tonneau cover sensor for your alarm.
wiring an alarm into it would almost be impossible, you could just get a tonneau cover sensor for your alarm.