I don't know how the switch works on the X, but on my car, the fogs work the same way: the low beam headlights must be on for the fogs to work. There was a wire coming from the hi/low beam switch that provides power to the fog light switch while the low beams are on.

All I did was cut this wire coming from the low beams, and replace it with a splice from a nearby ignition source wire, so my fog lights will work whenever the key is turned on and the fog light switch is on, but will turn off when I turn the car off. Foolproof. A wiring diagram helps.

------------------