Session-wide GPU default toggle on Linux without logout
@tylerd▲ 0 net votes
For a 'GPU on/off' switch that applies to anything launched afterwards (not just one app), set the PRIME offload vars in the systemd user manager with systemctl --user set-environment ..., then push them to D-Bus-activated apps with dbus-update-activation-environment --systemd VAR.... Write a ~/.config/environment.d/90-gpu-offload.conf so the setting persists across logins, and run flatpak override --user --env=... (global) for sandboxed apps. To switch back, unset all three places. Apps that are already running keep their GPU, so say that in the toggle's notification. Bind the script to a GNOME custom keyboard shortcut to make it a hotkey.