Auto-setting default apps when logging in different DEs

How can I set up Fedora 43 so that

when logging into KDE, the default browser is set to google-chrome and the default image viewer is set to gwenview

and when logging into Gnome, the default browser is set to chromium and the default image viewer is set to loupe?