Automatically turn off Plasma Desktop effects when launching a Steam game? - eviltoast

Title. Turning off the fancy effects (which can be done with Alt+Shift+F12) improves performance slightly, but having to toggle them on and off every time I start a game is… Y’know. A thing.

I was wondering if there was a way to automate it, like game opens -> they turn off, game process ends -> they turn back on