simons-public / protonfixes

A module for applying fixes at runtime to unsupported games with Steam Proton without changing game installation files
https://simons-public.github.io/protonfixes/
Other
233 stars 114 forks source link

Inline script and styles in Splash Screen #10

Closed pchome closed 6 years ago

pchome commented 6 years ago

Currently javascript and styles are fetched from CloudFlare CDN https://github.com/simons-public/protonfixes/blob/master/static/index.html

Which (IMHO) would not work correctly w/o network or CloudFlare access (e.g. Steam offline mode and network disconnected).

Describe the solution you'd like Inline those files contents. Or better drop cefpython3 dependency.

Describe alternatives you've considered Possible native solution: zenity, kdialog, libnotify, ... E.g. sleep 2 | zenity --progress --pulsate --auto-close works for me using https://stackoverflow.com/questions/13332268/python-subprocess-command-with-pipe#13332300 example.

Additional context Not applicable.

NoXPhasma commented 6 years ago

Since Steam has Zenity has dependency, it should be used.

pchome commented 6 years ago

BTW, if STEAM_RUNTIME enabled, Steam's zenity depends on steam-runtime, and my system simply have no some 32bit libraries. It looks like Proton using PATH and not LD_LIBRARY_PATH from STEAM_RUNTIME EDIT: Rather my fault, don't know what was that. Probably wrong env=env for zenity process.

 ~/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/bin $ ldd zenity 
        linux-gate.so.1 (0xf7f78000)
        libgtk-x11-2.0.so.0 => not found
        libgdk-x11-2.0.so.0 => not found
        libgdk_pixbuf-2.0.so.0 => not found
        libpango-1.0.so.0 => not found
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xf7edc000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xf7d78000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xf7bf7000)
        libnotify.so.4 => not found
        libpthread.so.0 => /lib/libpthread.so.0 (0xf7bd6000)
        libc.so.6 => /lib/libc.so.6 (0xf79e3000)
        libffi.so.7 => /usr/lib/libffi.so.7 (0xf79d6000)
        libpcre.so.1 => /usr/lib/libpcre.so.1 (0xf794f000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0xf791b000)
        libdl.so.2 => /lib/libdl.so.2 (0xf7916000)
        /lib/ld-linux.so.2 (0xf7f79000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xf7911000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xf7909000)

So when I tested this in action, I had to specify full path to my system's zenity (not which). x86_64 version also present in steam-runtime/amd64/usr/bin/

$ ~/.steam/steam/ubuntu12_32/steam-runtime/run.sh ldd zenity output have no any not found .

simons-public commented 6 years ago

I'll make Steam's zenity the default splash screen. I'm still going to keep cef splash as an option since that's what I'm using on my HTPC and it matches big picture, but I'll get rid of the external css/js dependencies. I'm glad you pointed that out, didn't even realize it was loading normalize externally (which wouldn't prevent the splash from loading BTW, it's just a css import).

pchome commented 6 years ago

Also, somehow related but not deserves separate issue: winetricks can check new versions on github during run. Set env['WINETRICKS_LATEST_VERSION_CHECK'] = 'disabled' to save a few seconds (or minutes if github is offline).

Maybe not all versions do this, I'm not sure, but better to define this explicitly.

simons-public commented 6 years ago

@pchome Good idea, pushed to master with the new environment variable

simons-public commented 6 years ago

I'm doing some testing on using the steam zenity (since it's the only one that can be guaranteed to be on the system).

It's built against gtk2 (libgtk-x11-2.0.so, checked with ldd), so it won't run on my system at all because the installed zenity.ui file has a hard dependency on gtk+ version 3, so I'm not sure how system independent this will end up being.

simons-public commented 6 years ago

Looking at the source for zenity, it loads the zenity.ui file from ./ and /usr/share/zenity/.

I can run the steam zenity binary fine with an old zenity.ui file in the current directory (which does not support --pulsate unfortunately).

The only zenity.ui file I can find in the steam-runtime is steam-runtime/i386/usr/bin/zenity.ui, which has the same hard dependency on gtk+ 3.0 in it.

Instead of making zenity the default, I'm thinking about leaving the default to no splash like it is now, and add zenity as an optional dependency.

pchome commented 6 years ago

Yep, that the problem I talked about. I have no steam-runtime/i386/usr/bin/zenity.ui, and I have no idea how Steam using zenity.

pchome commented 6 years ago

On Gentoo Steam itself using system's zenity, and it's optional dependency (>=gnome-extra/zenity-3).

simons-public commented 6 years ago

I don't think the steam-runtime version of zenity works at all, I'm actually filing a bug right now in hopes that they can fix it.

I realize that most people will probably have a system zenity as a dependency for steam (it's on my system as well). I'm just going to try parsing the $PATH and removing 'steam-runtime' from the $PATH that gets sent to the subprocess.

NoXPhasma commented 6 years ago

I realize that most people will probably have a system zenity as a dependency for steam (it's on my system as well).

That's what I was talking about. For me the Steam package has Zenity as dependency as well. Would be surprised if this is different on any other distribution. Zenity is used to show updating the Steam runtime, for example.

simons-public commented 6 years ago

Ok, I made what I think is a reasonable compromise. If steam is in big picture mode and cefpython is installed, it will use the cef splash. Otherwise, it will use the system zenity (if it exists) as the splash. The fallback for not having cef or zenity is still no splash.

I had to use sleep 2; with Popen shell because zenity does not behave properly and forks for some reason, I'm not thrilled with the implementation but it works as expected.