Text this: Periodic dynamics of a general switching dynamical system