I have a script that I run from the desktop file:
#!/bin/bash
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1
#export QT_QPA_PLATFORM=wayland
export WLR_NO_HARDWARE_CURSORS=1
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway
export MOZ_WAYLAND=1
export MOZ_ENABLE_WAYLAND=1
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export GDK_BACKEND=wayland
# Jonathon's idea: +nvidia that doesn't work.....
#GBM_BACKEND=nvidia-drm
#__GLX_VENDOR_LIBRARY_NAME=nvidia
#export GBM_BACKEND=nvidia-drm
#export __GLX_VENDOR_LIBRARY_NAME=nvidia
exec sway --unsupported-gpu
#exec sway --my-next-gpu-wont-be-nvidia
I then chattr the desktop file so that updates do not overwrite it.
[Desktop Entry]
Name=Sway
Comment=An i3-compatible Wayland compositor
Exec=/home/xircon/.config/sway/swaylaunch.sh
Type=Application