coldfix / steam-acolyte

Lightweight Steam Account Switcher
The Unlicense
53 stars 4 forks source link

Flatpack still not working #25

Open coldfix opened 2 years ago

coldfix commented 2 years ago

I found the steam binary location for flatpak. it's under a wrapper. So, I get some module error.

$ steam-acolyte --prefix /var/home/zihad/.var/app/com.valvesoftware.Steam/.steam --exe /var/lib/flatpak/app/com.valvesoftware.Steam/x86_64/stable/active/files/bin/steam-wrapper

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Not replacing login data for logged out user: ''
Traceback (most recent call last):
  File "/var/lib/flatpak/app/com.valvesoftware.Steam/x86_64/stable/active/files/bin/steam-wrapper", line 5, in <module>
    from steam_wrapper import main
ModuleNotFoundError: No module named 'steam_wrapper'

Steam acolyte pop up. but it does nothing. And clicking the add account button shows the module error.

Note: I am using Fedora silverblue. That's why my home directory starts with /var. but for regular distro that's not needed.

Originally posted by @tazihad in https://github.com/coldfix/steam-acolyte/issues/24#issuecomment-1272540071

coldfix commented 2 years ago

Thanks. That looks like it's missing some environment variables or similar (python env). What's the correct way to launch the flatpack steam from a terminal without errors? From https://github.com/coldfix/steam-acolyte/pull/18 it would seem to just have been typing com.valvesoftware.Steam, but that doesn't seem to be the case for you. Ignore acolyte for now, just talking about steam itself. If you don't know, you can try checking what your launchers do exactly.

coldfix commented 2 years ago

@coldfix this is the exact command from application menu to launch steam
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam @@u %U @@

Originally posted by @tazihad in https://github.com/coldfix/steam-acolyte/issues/24#issuecomment-1272543469

coldfix commented 2 years ago

Okay. Do you know what the @@u %U @@ placeholders are for? For now I recommend you create an executable steam-flatpack that executes the correct command and invoke acolyte with --exe steam-flatpack.

We will have to make this more straightforward later on.

tazihad commented 2 years ago

@coldfix this is from doc. https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-run

tazihad commented 2 years ago

@coldfix I have created script at /var/home/zihad/.local/bin as flatpak-steam.

#!/bin/bash
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper --file-forwarding com.valvesoftware.Steam @@u %U @@

ran command. steam-acolyte --prefix /var/home/zihad/.var/app/com.valvesoftware.Steam/.steam --exe steam-flatpak And it worked. I am able to use two account. I will check if some bugs exists.

coldfix commented 2 years ago

Great. I believe %U is a placeholder from the .desktop entry spec, where arguments should be passed as URLs. This won't work with bash, so it's probably better to leave it out. So this might work as well:

#!/bin/bash
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper

or, in order to give other programs the chance to pass down parameters, do this:

#!/bin/bash
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper \
                      --file-forwarding com.valvesoftware.Steam @@u "$@" @@

i.e. replace %U by "$@" (quotes are important).

tazihad commented 2 years ago

first command doesn't work.

#!/bin/bash
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper
error: APP must be specified
See '/usr/bin/flatpak run --help'

But 2nd command works as before. no problem.

#!/bin/bash
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/steam-wrapper \
                      --file-forwarding com.valvesoftware.Steam @@u "$@" @@
coldfix commented 2 years ago
error: APP must be specified
See '/usr/bin/flatpak run --help'

ah right, I accidentally removed the com.valvesoftware.Steam part from the command as well.. but just use the second form for now, anyway!