tkashkin / Adwaita-for-Steam

A skin to make Steam look more like a native GNOME app
MIT License
1.12k stars 25 forks source link

Installer: Patch Steam Library Files (Fixes #113, #119) #120

Closed Foldex closed 1 year ago

Foldex commented 1 year ago

Well it's worse than what we had before, but not much of a choice. Adds steam patching ala SFP to the installer, which will get the library theming working again.

This does mean a reinstall will have to be performed on client update, unless we want to make the installer have an option to run in the background and watch for file changes. I think the graphical installer would be a better place for something like that though.

This has some bits for chat patching too, but as that still works for the moment I've left it as is. Moving forward we'd probably want to do something cleaner and have chat/library specific css files rather than the monolithic webkit.css, but shrug.

tkashkin commented 1 year ago

Should be good enough for now. I don't think it's worth doing anything more that that until we get an answer to the issue or until we see what will be changed in the next few betas.

Valve is porting a lot of things from VGUI recently and now it seems they are working on the new Settings dialog, so I expect to see more big changes soon.

I hope Valve will provide a supported way to modify CSS, but the most likely outcome I expect at this point is them removing the official skin support entirely as they transition from VGUI.

IceDBorn commented 1 year ago

@Foldex I'm packaging this for NixOS and I have to convert the code you added to bash, can I communicate with you somehow? i have some questions.

Foldex commented 1 year ago

@IceDBorn I'm not too familiar with Nix, but is there a particular reason you would need to convert it to bash? I can't imagine it would have issues supporting a python script.

You can reach me at foldex@pm.me

tkashkin commented 1 year ago

@IceDBorn If you want to package the skin itself and not the graphical installer app, consider a few problems you'll have:

  1. Steam only loads skins from ~/.steam/steam/skins (~/.var/app/com.valvesoftware.Steam/.steam/steam/skins for flatpak).
  2. Symlinks don't work for skins, Steam won't detect symlinked skins.

So you'll have to somehow install the skin to the user's home directory, which is usually a discouraged practice for most package formats and distros, or not possible, at least without custom post-install scripts. I don't know if it's allowed or encouraged for Nix packages.


Another problem is that this skin is configurable and some parts of it are generated at install time, so it doesn't make a lot of sense to package it. Maybe this is not much of a problem for Nix as opposed to other package formats if a Nix package can have options.

IceDBorn commented 1 year ago
  1. Steam only loads skins from ~/.steam/steam/skins (~/.var/app/com.valvesoftware.Steam/.steam/steam/skins for flatpak).
  2. Symlinks don't work for skins, Steam won't detect symlinked skins.

@tkashkin I package the skin and then use home manager to place the files to the correct path. Home manager uses symlinks, symlinking the whole folder does not work but doing so with individual items recursively works.

Another problem is that this skin is configurable and some parts of it are generated at install time

I patch the install script, to install the skin and apply the patches in the root folder of the package.

IceDBorn commented 1 year ago

Here's the bash code I ended up with

tkashkin commented 1 year ago

@Foldex

I've noticed a problem: the stylesheets we patch are also applied to the Deck UI/New Big Picture and they break some things there.

We'll need to adjust selectors to only apply to the desktop client, or make some Deck/BP specific fixes. I don't think the skin should touch BP at all, at least for now, so the first option is better.