I am using a 5 inch HDMI screen on a RPI 3 which will just turn blue when screen blanking is active. My idea is to switch it off when screen blanking gets activated using a GPIO and a FET. I am able to write some code to do that. Is there a way to trigger that script on screen blanking and again when the screen is supposed to be turned on.