protonscr

Adding a non-Steam game that requires a command (e.g. java -jar "~/Minecraft.jar") does not work

steamclosed Feature RequestreviewedSteam client
ValveSoftware/steam-for-linux#3101 · opened 2014-01-15 by Zachs-Kappler · updated 2017-10-27 · 5 comments · github
ZZachs-Kappler 2014-01-15 github

I've been trying to figure out what is going on with adding certain launchers (.desktop files) to games or programs to Steam. From my experimentation and due to how sparse the options are regarding non-Steam games, I have found that the only launchers that work are those that are already installed by your package manager and do not need extra commands added to them to make them work.

I wanted to add Minecraft and the Feed The Beast Launcher to Steam to make them easier to launch; but given the method of executing them requires using a java command and not a binary executable, I cannot.

This could also affect programs that are built with Python, Shell, and other interpreted languages.

Ggdrewb-valve maintainer 2014-01-15 github

What does the Exec line in the .desktop say? I assume it's got multiple parts, like 'java x'. Steam can't tell what is the application vs. what's a command-line argument so it can't tell in this case the app is x instead of java. You can edit the game properties to fix this up.

ZZachs-Kappler 2014-01-16 github

I've tried The following for the launcher's Exec lines:

java -jar "/home/daniel/Games/Minecraft/Minecraft.jar"
java -jar /home/daniel/Games/Minecraft/Minecraft.jar

The properties dialog inside Steam is a bit vague as to what goes where (Target should be command, Start In should be Location, etc.) and it seems that just copying the launcher's exec line into Target in the properties dialog works.

Ggdrewb-valve maintainer 2014-01-16 github

Leaving this open in case there's something we can do to auto-handle this kind of thing.

CChlorideCull 2014-01-18 github

I can think of one (albeit hacky) way to do it, and that is

  • Parse the Exec value
  • Remove all occurrences of %[fFuUdDnNkv] from said value
  • Run said value with sh -c when launching the game, thus enabling shell expansion and other goodies.