Fan enabled with steppers?

Hello all! I have a Azteeg X5 board running Smoothieware, and I’ve got the bigger stepper motor controllers on it. I’d like to setup active cooling but tie it to a switch to not have it on all the time. Is there a way to tie a switch to the enable pin of the steppers so that I can use it to turn on the cooling fan(s)?

Thanks in advance!

I guess declare an additional axis, and set it’s en pin to whatever pin you want to control the fan, would probably work.