Implements #86.
Overview
Adds Frostworx's SteamTinkerLaunch utility as a ctmod
to allow for streamlined installation and uninstallation across distros and on Steam Deck. Stable releases and the latest git (gated behind ProtonUp-Qt's "Advanced Mode") can be installed. Stable releases show a list of versions in its dropdown whereas the git release shows branches in the interest of potential future-proofing. Currently, SteamTinkerLaunch only has a master branch, but if there are any very experimental features that a user wants/needs, they will be able to install it.
SteamTinkerLaunch Flatpak installation (only for Flatpak Steam) is also supported.
Note: I am not the creator of SteamTinkerLaunch, I just contribute to it every so often and try to help out with the community around it.
SteamTinkerLaunch is installed following the "manual (non-root)" installation method, but we do all the heavy lifting for the user to get them set up, such as setting up the language files and adding SteamTinkerLaunch to PATH. We also manage full uninstallation of SteamTinkerLaunch. This not only makes a manual non-root install a few button clicks, but also makes uninstallation a single click! There's no worry of bloating up your Steam Deck for example with a bunch of miscellaneous files, or having to fumble around with the on-screen keyboard to edit your path.
Features
- Steam Deck support
- Very fast installation with all manual steps taken care of
- Can be easily uninstalled
- Can be updated without clearing the
$HOME/.config/steamtinkerlaunch
folder, which is important as that's where Vortex/MO2 mods live.
- SteamTinkerLaunch is automatically set as a compatibility tool *and added to all of the user's shell PATHs, meaning SteamTinkerLaunch can be used as a launch option from Steam for Native Linux games. Currently the user will have to enter the absolute path as just typing
steamtinkerlaunch %command%
doesn't work. There's probably a way to use something like $(which steamtinkerlaunch) %command%
but I haven't found it yet.
- As SteamTinkerLaunch is added to the PATH users can run
steamtinkerlaunch
commands, taking advantage of some of the command line features like steamtinkerlaunch addnonsteamgame
.
- From within ProtonUp-Qt, SteamTinkerLaunch can be set as a compatibility tool via the Game List by selecting the
Proton-stl
option. This is the internal name for SteamTinkerLaunch.
- Users can see which apps and how many are using SteamTinkerLaunch from the About Compatibility Tool window.
Okay, enough advertising, now onto the technical bits!
How It's Installed
The installation steps on Desktop and Steam Deck are very similar. The main difference is that SteamTinkerLaunch will manage downloading its dependencies itself on Steam Deck, and it will also configure its language files correctly.
- If not on Steam Deck, Check that all the SteamTinkerLaunch Hard Dependencies are installed.
- The SteamTinkerLaunch tarball is downloaded from GitHub to and extracted inside of
$HOME/stl
.
- If not on Steam Deck, we set up the language files automatically based on a map of locales and corresponding SteamTinkerLaunch language files. We get the user's locale (defaults to
en_US
) and copy the mapped language text file to $HOME/.config/steamtinkerlaunch/lang
.
- The
steamtinkerlaunch
script downloaded earlier is given an initial run to set up its $HOME/.config/steamtinkerlaunch
configuration structure.
- Add SteamTinkerLaunch to the Shell path for Bash (
.bashrc
), Zsh (.zshrc
), Ksh (.kshrc
) and Fish shell ($HOME/.config/fish_variables
) if it isn't already present - Yes, this even works on Steam Deck! Any opened terminal sessions and the like will probably need restarted so they can reload their Shell RC files, but this is general shell behaviour.
- For every shell, a note is placed above the path line to say that it was
# Added by ProtonUp-Qt on %d-%m-%Y %H:%M:%S
for transparency.
- For Bash, Zsh and Ksh,
if [ -d "<stl_path>" ]; then export PATH="$PATH:<stl_path>"; fi
is added to the appropriate Shell RC files.
- For Fish shell, the
fish_variables
file is edited to either prepend the <stl_path>
to the fish_user_paths
variable, or create this variable if it doesn't exist and set it to<stl_path>
.
- Adds SteamTinkerLaunch as a compatibility tool using its built-in command
./steamtinkerlaunch compat add
. This creates $HOME/.local/share/Steam/compatibilitytools.d/SteamTinkerLaunch
, which has a couple of .vdffiles and a
steamtinkerlaunch` symlink file which points to the download location of the earlier SteamTinkerLaunch download.
The whole thing takes less than 15 seconds to download and install on my laptop. On my Steam Deck it's a little longer, still less than a minute, as SteamTinkerLaunch downloads various dependencies on Deck from the Arch repos and Valve's Arch mirrors. Of course, these times can vary and the main factor here will be internet speed and server speed :slightly_smiling_face:
How It's Uninstalled
The uninstallation steps are virtually the installation steps in reverse. We remove the compatibility tool from compatibilitytools.d
, we remove $HOME/.config/steamtinkerlaunch
and we remove the entire $HOME/stl
folder. We also remove SteamTinkerLaunch from the shell paths, for Fish path we take extra care preserving any existing user paths while also removing the note that the paths were modified by ProtonUp-Qt.
Flatpak Paths
The Flatpak will probably need permission for the following paths:
$HOME/
- For the Shell RC files and to create $HOME/stl
if it doesn't exist.
$HOME/stl/
- All SteamTinkerLaunch install files live here, included the dependencies it downloads for Steam Deck.
$HOME/.config/steamtinkerlaunch/
- SteamTinkerLaunch configuration folder, this is where the language files go and where SteamTinkerLaunch config stuff goes.
$HOME/.config/fish/
- We check if this folder exists (to see if Fish is installed, since we can't use shutil.which('Fish')
with ProtonUp-Qt Flatpak) and if it does we edit the fish_variables
file to add SteamTInkerLaunch to the Fish shell user paths.
$HOME/.local/share/Steam/compatibilitytools.d/
- Where SteamTinkerLaunch sets up its compatibility tool folder and creates the symlink.
Testing
Right now I have only tested when running my fork of ProtonUp-Qt from source on my laptop (Arch Linux running KDE Plasma Wayland Session) and on my Steam Deck. I have not tested running via an AppImage or via Flatpak. I also have not tested installing SteamTinkerLaunch Flatpak for Flatpak Steam, as I don't have Flatpak Steam installed on any of my systems.
For testing AppImage, I think it would be a case of following the instructions to build an AppImage and then trying it out. For Flatpak though, I'm totally lost :sweat_smile:
Considerations
There are some concerns I have currently:
How To Deal With SteamTinkerLaunch Dependencies In ProtonUp-Qt Flatpak
Following discussion in #86, I'm not sure how to handle conveying to the user that SteamTinkerLaunch has a number of dependencies that need to be satisfied before it'll work. To mitigate this I have included a list of the Hard Dependencies in the Description field, also including a message that on Steam Deck the dependencies are managed.
Installing Versions Incompatible With Steam Deck
A realization I had is that a user might, for any reason, try to install an older version of SteamTinkerLaunch on Steam Deck. However, only SteamTinkerLaunch >= v10.0 support Steam Deck. I was wondering if maybe we should show a warning prompt when the user is on Deck tries to install an unsupported version of SteamTinkerLaunch.
Feedback
This ended up being a fair bit more complex than I initially intended, so please let me know if there's anything I messed up or anything that could be implemented better. I did my best to implement all the functionality needed to install SteamTinkerLaunch in the most efficient way I could, but I'm happy to clarify any decisions I made and change anything to meet the code standards of the project.
The commits aren't squashed yet as I wanted to do that after discussion and code review... and I might need some help with how to do that :sweat:
Huge thanks for all the patience, guidance and advice. It was vital and is very much appreciated :smile: