Make a Flatpak app actually start at login on Hyprland
Cause verified: xdg-desktop-portal-gtk's gtk.portal Interfaces line (FileChooser, AppChooser, Print, Notification, Inhibit, Access, Account, Email, DynamicLauncher, Lockdown, Settings, Wallpaper) has no org.freedesktop.impl.portal.Background, and neither hyprland nor wlr implement it, so the grep check genuinely prints nothing. The uwsm claim is confirmed by both the Hyprland wiki ('XDG Autostart is handled by systemd, and its target is activated in uwsm-managed session automatically') and the live omarchy.desktop, whose Exec line is exactly uwsm start -g -1 -e -D Hyprland hyprland.desktop. The systemd user-unit alternative is correctly wired (After/PartOf/WantedBy=graphical-session.target). Only nit: the xdg-desktop-autostart.target dependency listing will not show the new entry until the next login, since the generator runs at session start.
Symptom
A Flatpak app's own "Launch on system startup" / "Start minimized at login" setting does nothing. The toggle either flips itself back off or stays on while the app never appears after a reboot. Nextcloud, Element, Telegram and ProtonMail Bridge all behave this way, and native (pacman) builds of the same apps autostart fine.
Cause
That toggle asks xdg-desktop-portal for the Background portal (org.freedesktop.impl.portal.Background), which is what writes the autostart entry on the app's behalf. None of the backends a Hyprland box normally has implement it: xdg-desktop-portal-hyprland, xdg-desktop-portal-wlr and xdg-desktop-portal-gtk all lack Background (only the gnome/kde/dde/xapp backends have it). With no implementation the request never completes and no autostart file is ever created.
Fix
Confirm the gap first. This should print nothing:
grep -l Background /usr/share/xdg-desktop-portal/portals/*.portal
Then write the autostart entry yourself. Omarchy launches the session through uwsm (uwsm start -g -1 -e -D Hyprland hyprland.desktop), which activates xdg-desktop-autostart.target, so a plain XDG autostart file is honoured:
mkdir -p ~/.config/autostart
cat > ~/.config/autostart/com.nextcloud.desktopclient.nextcloud.desktop <<'EOF'
[Desktop Entry]
Type=Application
Name=Nextcloud
Exec=flatpak run --branch=stable --arch=x86_64 com.nextcloud.desktopclient.nextcloud --background
X-GNOME-Autostart-enabled=true
EOF
Use the app's real id and its real background flag (flatpak run <id> --help). Check it was picked up:
systemctl --user list-dependencies xdg-desktop-autostart.target
If you would rather have systemd supervise it, use a user unit instead of an autostart file:
mkdir -p ~/.config/systemd/user
cat > ~/.config/systemd/user/nextcloud.service <<'EOF'
[Unit]
Description=Nextcloud desktop client
After=graphical-session.target
PartOf=graphical-session.target
[Service]
ExecStart=/usr/bin/flatpak run com.nextcloud.desktopclient.nextcloud --background
Restart=on-failure
RestartSec=5
[Install]
WantedBy=graphical-session.target
EOF
systemctl --user daemon-reload
systemctl --user enable --now nextcloud.service
Installing xdg-desktop-portal-gnome just to get the Background portal is not worth it. It pulls in GNOME session pieces and competes with the Hyprland backend for other interfaces.
Verify
Log out and back in: the app is running (flatpak ps lists it), or systemctl --user status nextcloud.service is active. ls ~/.config/autostart/ shows your entry.