Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support autostart on flatpak #8619

Open
MattSturgeon opened this issue Jun 6, 2022 · 5 comments
Open

Support autostart on flatpak #8619

MattSturgeon opened this issue Jun 6, 2022 · 5 comments

Comments

@MattSturgeon
Copy link

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.

@MattSturgeon
Copy link
Author

MattSturgeon commented Jun 6, 2022

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

@ChaosBlades
Copy link

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

Screenshot from 2022-09-02 16-37-20

@MattSturgeon
Copy link
Author

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.

@ChaosBlades
Copy link

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.

@shrublet
Copy link

shrublet commented Nov 9, 2023

Replying to #8619 (comment)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants