Run everything with an environment variable except kwin?

I want to run everything with Zink (by setting an environment variable) without modifying launch scripts and desktop files individually, but on my graphics card kwin still doesn’t fully work with Zink, so is there a way to set the environment variable where kwin will be exempt but all clients will have it?

I prefer Zink over my native GPU drivers for games because games have to run in Vulkan to be granted tearing by Kwin.

I guess there are several options:

  1. Start the session with the Zink environment and restart KWin from a terminal after unsetting the variable
  2. Modify KWin’s systemd unit file to unset the variable or set it to a different value

However, given you apparently only really need Zink for games, it begs the question if you can’t just make sure their environment is set up that way and the rest of the system simply runs with defaults

The issue with that is that it complicates the process of installing games outside of a launcher that already has the environment variable, I have to edit their launcher every time e.g. when playing open source games from distro repositories.

I did figure out a script for .config/plasma-workspace/env to unset MESA_LOADER_DRIVER_OVERRIDE for kwin_wayland only. I don’t know if this is the best way to do but it works.