2. do you have the appropriate XDG variables set ( env | grep -i xdg )
3. how are you launching your wayland WM and I don't mean the DM (like sddm, greetd...), what is the actual script/desktop being launched
I use gtkgreet to call one of many scripts depending on the WM I want to use or test
do_sway
do_wayfire
do_labwc
do_hyprland
do_hikari
Each one is almost the same
SWAY
Code: Select all
cat do_sway
#!/bin/sh
# Session
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway
source /usr/local/bin/wayland_enablement.sh
dbus-run-session sway $@Code: Select all
cat do_hyprland
#!/bin/sh
# Session
export XDG_SESSION_DESKTOP=Hyprland
export XDG_CURRENT_DESKTOP=Hyprland
source /usr/local/bin/wayland_enablement.sh
dbus-run-session Hyprland $@
WAYLAND VARIABLES
Code: Select all
cat wayland_enablement.sh
#!/bin/bash
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export QT_AUTO_SCREEN_SCALE_FACTOR=1
export QT_QPA_PLATFORMTHEME=qt5ct
export QT_QPA_PLATFORM="wayland;xcb"
export _JAVA_AWT_WM_NONREPARENTING=1
export NO_AT_BRIDGE=1
export GTK_USE_PORTAL=0
export CLUTTER_BACKEND=wayland
export SDL_VIDEODRIVER="wayland,x11"
export SDL_AUDIODRIVE=pipewire
export WLR_RENDERER=vulkan
#export MESA_LOADER_DRIVER_OVERRIDE=zink
export VDPAU_DRIVER=radeonsi
export XDG_SESSION_TYPE=wayland
export XKB_DEFAULT_LAYOUT=gb
export XKB_DEFAULT_VARIANT=pc104But then each WM then has its own startup to launch desirable applications, including portals
SWAY
~/.config/sway/config -> include ~/.config/sway/config.d/*.conf
~/.config/sway/config.d/*.conf/autostart.conf
Code: Select all
exec gentoo-pipewire-launcher restart
exec /usr/libexec/xdg-desktop-portal-gtk -r
exec /usr/libexec/xdg-desktop-portal-wlr -r
exec /usr/libexec/flatpak-portal --no-idle-exit -r
exec "sh -c 'sleep 5;exec /usr/libexec/xdg-desktop-portal -r'"
exec xhost +SI:localuser:$(id -un)
exec xhost +SI:localuser:root
exec discord
exec openrazer-daemon --respawn
exec thunar --daemon
exec mako
exec xrdb ~/.Xresources
exec waybar
exec flatpak run com.valvesoftware.Steam -console.config/hypr/hyprland.conf
exec-once = ~/.config/hypr/scripts/sleep.sh
exec-once = ~/.config/hypr/scripts/xdg_portals.sh
source= ~/.config/hypr/scripts/exec.conf
Code: Select all
cat xdg_portals.sh
#!/bin/bash
sleep 1
killall -e xdg-desktop-portal-gtk
killall -e xdg-desktop-portal-wlr
killall -e xdg-flatpak-portal
killall xdg-desktop-portal
/usr/libexec/xdg-desktop-portal-gtk -r &
/usr/libexec/xdg-desktop-portal-wlr -r &
/usr/libexec/flatpak-portal --no-idle-exit -r &
sleep 2
/usr/libexec/xdg-desktop-portal -r &In short
1. your login must create the key XDG variables and run dir. elogind will do alot for you otherwise you will need to (as per gentoo wiki: https://wiki.gentoo.org/wiki/Sway#Starting_Sway which also state a mising dbus session is bad. This isn't unique to sway)
2. the login must start a user dbus session and create the env DBUS_SESSION_BUS_ADDRESS
3. the user then must launch the required portals.
An integrated desktop like GNOME and KDE will do all this for you (X11 or Wayland) but the moment you hand-craft a session you take responsibility to ensuring everything is launched and in the right order.



