I run a game from steam which starts with the game companies launcher app where I have to click another button to start the actual game. The game launcher is very slow, contains needless advertising, which I should not be forced to experience as I paid for the game in it's entirety, it is not a free online game paid for by advertising, and it sends my telemetry to different servers around the world!
Someone provided some simple code in a community guide to bypass the launcher but I cannot get it to work for reasons that make no sense to me.
Their simple code is to put this command in steam's properties for the game which works for them and other users
eval $( echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” )
But nothing happens when I start the game in steam, it just exits after 30 seconds or so. So I added tee to the command to see what sed ouputs, like this
eval $( echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” | tee ~/foot.txt)
And foo.txt is empty, which makes no sense because if I run this command
eval $( echo “%command%” | foo.bash )
Which is this script
#/bin/bash
echo "$*" > ~/foo.txt
Then foo.txt has the expected command line received by bash on STDIN that sed should be receiving.
So then I ran the same sed command with the --debug switch and get this output in a log
SED PROGRAM:
s/Launcher\/dowser.exe/Cities2.exe/g
INPUT: 'STDIN' line 1
PATTERN: /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Launcher/dowser.exe'
COMMAND: s/Launcher\/dowser.exe/Cities2.exe/g
MATCHED REGEX REGISTERS
regex[0] = 409-428 'Launcher/dowser.exe'
PATTERN: /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Cities2.exe'
END-OF-CYCLE:
/home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Cities2.exe'
So sed is receiving the expected data from steam on STDIN, and the sed commandline script is producing the expected result, but inexplicably eval is not recieving the sed output or not executing it.
Then just to see what happens, I ran the same command again but chained the sed output from the debug log after the sed command, so the result and output from sed would be thrown away, and the appended command would be run, like this
eval $( echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” & /home/user/.local/share/Steam/ubuntu12_32/reaper SteamLaunch AppId=949230 -- /home/user/.local/share/Steam/ubuntu12_32/steam-launch-wrapper -- '/home/user/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper'/_v2-entry-point --verb=waitforexitandrun -- '/home/user/.local/share/Steam/steamapps/common/Proton 8.0'/proton waitforexitandrun '/home/user/.local/share/Steam/steamapps/common/Cities Skylines II/Cities2.exe')
And the game successfully runs without the launcher!!!
I don't get it, why is eval not executing the sed output as the command, but does execute the command line that sed apparently does output when I chain it after the sed command?
The only downside to that execution was that steam does not recognize that the game has closed when I exit it, but I could live with that.
I am running on Ubuntu 23.10, using steam in X
eval
ing, some variable is likely getting set. But when the game is launched the first way, it's a new process, which doesn't have access to the variable that was set by eval. When you launch the game usingeval
and&&
simultaneously, you're ensuring that all variables/functions that were defined byeval
are available to the game executable. – B215826 Dec 11 '23 at 16:39&
"launches" the preceding command and runs it in the background, and the cmd-line processor proceeds to the next command on the cmd line. Any environment vars scoped to the first script will not affect the 2nd script. As far as&&
carrying env vars over, I guess I would have to see that. – shellter Dec 11 '23 at 20:11~/foot.txt
? – akostadinov Dec 11 '23 at 22:35eval
, you could tryexec bash -c "$(echo “%command%” | sed -E “s#Launcher/dowser.exe#Cities2.exe#g” )"
– akostadinov Dec 11 '23 at 22:38%command%
as/full/path/to/steam(.exe)
? Can you update your Q with the 2-3 most likely values that are%command%
? – shellter Dec 12 '23 at 15:47