By PyGuy from the SteamCommunityForum
Well, while it’s simple enough to just launch the game from a desktop shortcut, I’ve found that many people, cross-platform, have taken a liking to having all of their games on one client. So one day, I figured “why should Library shortcuts be limited to just Linux applications on the native client?”
This guide is pretty lengthy, but don’t worry. Most of it is just extra details for newbies.
The first thing we are going to do is create a short bash script that Steam for Linux will launch the game from as a Non-Steam shortcut. If you have absolutely no experience with code, don’t be intimidated by this. Only three lines of code are required, and the writing process should be familiar to anyone who has ever launched a program through a terminal.
Simply right click anywhere on your desktop (or any folder in your preferred file explorer), and navigate to Create New Document > Empty Document. After that, simply rename it to anything without spaces and ending with “.sh” In this example, I’ll be putting World of Warcraft in my Steam for Linux library, so I’ll be naming it WoW.sh; short and sweet.
As aforementioned, the script will be used to launch your game, so here is a small breakdown of the script I used to launch World of Warcraft:
cd “/home/andrew/.PlayOnLinux/wineprefix/World_of_Warcraft/drive_c/Program Files (x86)/World of Warcraft”
This is what every bash script begins with. It’s basically letting the computer know that you are writing a script of this type.
The purpose of this line is to navigate to where you installed the game (cd = “change directory”). In this case, I navigated to my World of Warcraft folder. Make sure it navigates to where the .exe file is for your game. An easy way to write this line is to type “cd” and then copy and paste the directory in the form of text.
Finally, this line is used to launch the game with Wine, because Windows games will not open on Linux machines without it.
Once you’re finished writing your script, save and close the text editor. Lastly, you must right click on the file and go to Properties. From there, go to the Permissions tab and tick the box next to “Allow executing file as program.” Go ahead and test it out by double clicking on your script. If the game successfully launches, then you’re good to go onto the next step.
Now, with Steam open, click “ADD A GAME…” on the bottom left corner of the window and click “Add a Non-Steam Game…” Your script won’t show up in the list, so select some boring application that you’ll probably never need in your Steam library, such as Calculator, and then click “ADD SELECTED PROGRAMS…”
Once it’s added, right click on the application that’s now in your library and go to Properties. In Properties, change the program’s name (Calculator in my case) to the name of your game. More importantly, you must modify the contents of the “Target” and “Start In” text fields. Change the Target to the directories leading to the script file you created. For example, in my case, it’s
“/home/andrew/Desktop/WoW.sh” (keep the quotation marks). For the “Start In” field, type the exact same thing, except without the script file name at the end.
Finally, here’s what the Properties menu looks like for World of Warcraft.