You might consider a inline cable like this Cable with switch on Amazon
sure, this might be easier though, could cut and solder the ends to make it more compact or just leave it all plugged in.