steam-for-linux
steam-for-linux copied to clipboard
Support autostart on flatpak
Your system information
- Steam client version (build number or date): May 28 2022, at 01:45:53
- Distribution (e.g. Ubuntu): Flatpak/flathub (actual distro is openSUSE Tumbleweed)
- Opted into Steam client beta?: [No]
- Have you checked for system updates?: [Yes]
Please describe your issue in as much detail as possible:
Because flatpaks are run within a runtime container, with limited access to the host system, Steam cannot simply create a file in ~/.config/autostart. This means ticking Run Steam when my computer starts has no effect.
Proposed solution
Implement support for flatpak's portals feature. This can either be used by directly sending requests over dbus, or you can use the libportal library's RequestBackground() method. The library should always be present when running as a flatpak.
Workaround:
If anyone stumbles on this issue and simply wants to get flatpak steam to autostart, you can manually copy the flatpak's .desktop to ~/.config/autostart (or $XDG_CONFIG_HOME/autostart if you've configured a custom config directory).
flatpak will installs symlinks to the .desktop in /var/lib/flatpak/exports/share/applications (or ~/.local/share/flatpak/exports/share/applications if the flatpak isn't installed system-wide), but you'll need to copy the actual .desktop file, not the link.
You can use cp's -L option to follow symbolic links, so you can just do:
cp -L "/var/lib/flatpak/exports/share/applications/com.valvesoftware.Steam.desktop" ~/.config/autostart/
If you want steam to autostart minimised, as per #5806:
After you copy the .desktop file, open it in a text editor and edit the first line beginning with Exec=: Simply replace everything after com.valvesoftware.Steam with -silent. In my case, I changed:
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam @@u %U @@
into:
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam -silent
There is a way simpler way to get steam to autostart with flatpak.
Add the following to your startup applications.
flatpak run com.valvesoftware.Steam -silent

There is a way simpler way to get steam to autostart with flatpak.
Add the following to your startup applications.
flatpak run com.valvesoftware.Steam -silent
That will do essentially the same thing as the more manual workaround (adds a .desktop file to ~/.config/autostart). Unfortunately not all distros come with a startup application manager, but if yours does then this is definitely easier.
Can't believe some distros still don't have the most basic of tools. I guess Steam does not have the most basic of functionality either so there is that. I have used a lot of distros and it has always been somewhere in the GUI. Maybe if you built base Arch or Gentoo but then if you did that you wouldn't be here looking for instructions. No wonder "The year of the linux desktop" never happens and everyone needs to explain things in a "behind the hood" manner scaring away new users.
Replying to https://github.com/ValveSoftware/steam-for-linux/issues/8619#issuecomment-1147888148
Stumbled onto this thread while trying to create .desktop files, and I'm not sure if it's just me, but I was having issues with MimeTypes not working correctly if I simply copied the .desktop file.
Edit: Just needed to run update-desktop-database ~/.config/autostart for mimetypes to be properly associated. This allows stuff like xdg-open steam://library to work.
I think the big pictures is not working after the reboot.
I have tried 3 times, set on, then after restart it opens, but not big and the setting is turned back to off.